Questions tagged [django-1.3]

Django 1.3 is a version of the Django framework, released in March 2011. Please only use this tag if your question relates specifically to this version.

Django 1.3 is a version of Django framework, released in March 2011. Please only use this tag if your question relates specifically to this version.

See the release notes for more details.

135 questions
5
votes
3 answers

How secure directories? And how to create new directories when a user registers?

I'm creating a video sharing website in django. Currently, if a user registers, and upload a video, it will be uploaded to media/vid/uploaded-vid. Then i converted using ffmpeg to flv. What i would like to do is this: Someone with the username of…
user
  • 973
  • 4
  • 14
  • 29
5
votes
2 answers

In django-admin, how can I set filter_horizontal as the default?

The default widget for ManyToManyFields in django-admin is difficult to use. I can set filter_horizontal on individual fields and get a much nicer widget. How can I set filter_horizontal as the default on all ManyToManyFields? (I'd also be happy…
Jerome Baum
  • 736
  • 6
  • 15
5
votes
1 answer

Cannot register custom logging handler class with Django dictConfig

My goal is to create a "log" app, apart from my main app, that will be used for several custom handler classes, filters, etc, and other error and stat reporting. But when running the dev server for my Django project, I receive the error: File…
WilHall
  • 11,644
  • 6
  • 31
  • 53
4
votes
1 answer

Django logging with dictConfig cannot find "logging" module

My LOGGING directive in settings is set to: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'default': { 'format': '[%(asctime)s] %(levelname)s::(%(process)d %(thread)d)::%(module)s -…
WilHall
  • 11,644
  • 6
  • 31
  • 53
4
votes
2 answers

Django 1.3: Problems with UserProfile after upgrade

After an upgrade to Django 1.3 (from 1.2.3) the following row causes a crash: users = self.users.filter(userprofile__public_profile=True).order_by('first_name') The error shown: Caught FieldError while rendering: Cannot resolve keyword…
Björn Lilja
  • 393
  • 1
  • 4
  • 14
4
votes
1 answer

Django1.3 multiple gunicorn workers caching problems

i have weird caching problems with the 1.3 version of django. I probably have something configured wrong, but am not sure what. A good example is django-avatar, which uses caching and many people use it. Even if I dont have a cache backend defined…
4
votes
1 answer

Trouble using django.template Context in unittest

I got a little confusing situation here when I use the Context from django.template. The following works in the python shell: >>> from django.template import Context, Template >>> b=Template('TEST').render(Context()) >>> print b TEST When I use the…
Jingo
  • 3,200
  • 22
  • 29
3
votes
2 answers

Django admin: how do I filter a ForeignKeyField widget based on the object's (not request.user's) data?

I have Chart and Module models (see code below). Each chart belongs to a module (via a ForeignKey). A chart may have another chart as its parent (another ForeignKey). What I would like in the admin is that the dropdown for parent on a particular…
Tikitu
  • 679
  • 6
  • 22
3
votes
2 answers

How do I paginate WeekArchiveView?

In continuation of my struggle with WeekArchiveView, how do I paginate it by week? All I want is: to know if there is next / previous week available; in case there is, provide a link in the template. I'd like it to also skip empty weeks. The…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
3
votes
1 answer

Can I combine Create and List class based generic views using mixins?

I'm looking for the easiest way to combine List and Create functionally with generic class views. I want to have a page that has an item list and a form to add a new item on the bottom. I thought that mixin architecture would allow to combine…
3
votes
2 answers

Django messages framework not working in template loop

I recently upgraded to Django 1.3 and I want to start using the Messages system. I have added my Middleware, Template context processors and also messages into the INSTALLED_APPS MIDDLEWARE_CLASSES = ( …
ApPeL
  • 4,801
  • 9
  • 47
  • 84
3
votes
1 answer

How to fill model field value from a different ModelForm field with some calculation?

I want to have age field in my ModelForm and use it to fill birth_year in the model. What is the idiomatic way to do this? What method should I provide in my form or model or meta class?
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
3
votes
1 answer

Django testing with assertRaises fails to realise that exception raised is the one expected

I have the following test code snippet with self.assertRaises(models.NotEnoughInventorySpace): self.inv2.add_item(self.item2, 1) The test fails: Creating test database for alias…
QasimK
  • 440
  • 3
  • 11
3
votes
3 answers

Django 1.3 CreateView/ModelForm: unique_together validation with one field excluded from form

I am looking for a simple answer by example to this common problem. The answers I found so far leave out critical points for us beginners. I have an app where almost every model has a ForeignKey to User, and there is a unique_together constraint,…
user658587
3
votes
1 answer

Django 1.3 CreateView, ModelForm and filtering fields by request.user

I am trying to filter a field on a ModelForm. I am subclassing the generic CreateView for my view. I found many references to my problem on the web, but the solutions do not seem to work (for me at least) with Django 1.3's class-based views. Here…
user658587
1
2
3
8 9