﻿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
13784	pre_save is dispatched before executing upload_to attributes on FileFields when using ModelForm	Peter Bengtsson	nobody	"Suppose you have this code:

{{{
def callable_upload_to(instance, filename):
    full_path = os.path.join(this_year(), filename)
    print ""PLACING"", full_path
    return full_path

class Foo(models.Model):
    file = models.FileField(upload_to=callable_upload_to)
    size = models.IntegerField(null=True)

def update_foo(sender, instance, **kwargs):
    print ""UPDATING"", str(instance.file)

pre_save.connect(update_foo, sender=Foo)
}}}

Suppose you create one of these instances with a '''!ModelForm''' you'll get this output on stdout:
{{{
UPDATING sample.file
PLACING 2010/sample.file
}}}

That means that you can't rely on the file path as dictated by the upload_to callable in your pre_save signal. Especially important is that within your {{{pre_save}}} method you can't even get to the file since it doesn't exist. 
"		closed	Forms	1.2		duplicate	ModelForm pre_save		Unreviewed	0	0	0	0	0	0
