pre_save used on FileField/ImageField doesn't work
|Reported by:||Lior Gradstein||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If I set a signal that intercepts as pre_save and try to access a FileField/ImageField's path, I don't get the same result. It seems the 'upload_to' attribute is not taken into account!
Here's a very simple example to show the problem:
- settings.py (relevant parts only):
MEDIA_ROOT = '/tmp/static'
MEDIA_URL = '/static/'
from django.db import models
from django.db.models import signals
myfile = models.FileField(upload_to="uploads")
def intercept(sender, instance, signal, *args, kwargs):
- In Django 1.0.2-final:
- In Django 1.1+ (1.1beta and latest SVN version 1.1 beta 1
Please the associated thread on http://groups.google.com/group/django-developers/browse_thread/thread/ce20f196f5e85296