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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25088>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
You need to keep the `make_upload_path()` function around as long as it's
referenced in migrations. See
https://docs.djangoproject.com/en/stable/topics/migrations/#historical-
models.
--
Ticket URL: <https://code.djangoproject.com/ticket/25088#comment:1>