﻿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
25088	Migrations fail when change upload_to from function to sting type	argaliev	nobody	"In first migration function make_upload_path was passed to upload_to property of FIleField:
{{{
def make_upload_path(instance, filename):
    return 'auto_scripts/{0}/{1}'.format(instance.id,filename)

class file_imports(models.Model):
    orig_file = models.FileField(upload_to=make_upload_path, blank=True, null=True)
}}}
Then upload_to was changed to hardcoded string and function make_upload_path was deleted.

{{{
orig_file = models.FileField(upload_to='auto_scripts/', blank=True, null=True)
}}}
and getting following error when starting makemigrations:
{{{
......
File ""...../main/migrations/0001_initial.py"", line 108, in Migration
    ('orig_file', models.FileField(upload_to=main.models.make_upload_path, null=True, 
AttributeError: 'module' object has no attribute 'make_upload_path'
}}}

Looks like migrations still want to see old function make_upload_path in code, but it does't need anymore.
"	Uncategorized	closed	Migrations	1.8	Normal	invalid	Migrations		Unreviewed	0	0	0	0	0	0
