﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10948	pre_save used on FileField/ImageField doesn't work	Lior Gradstein	nobody	"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/'

* models.py:

from django.db import models
from django.db.models import signals

class MyModel(models.Model):
    myfile = models.FileField(upload_to=""uploads"")

def intercept(sender, instance, signal, *args, **kwargs):
    print instance.myfile
    print instance.myfile.path
    print instance.myfile.url

signals.pre_save.connect(intercept, sender=MyModel)

- In Django 1.0.2-final:

uploads/a__.flv
/tmp/static/uploads/a__.flv
/static/uploads/a__.flv

- In Django 1.1+ (1.1beta and latest SVN version 1.1 beta 1
SVN-10367):

a.flv
/tmp/static/a.flv
/static/a.flv 

Please the associated thread on http://groups.google.com/group/django-developers/browse_thread/thread/ce20f196f5e85296"		closed	File uploads/storage	dev		duplicate			Unreviewed	0	0	0	0	0	0
