Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.7 migrations and format_filename #8

Open
ryanbagwell opened this issue Jan 16, 2015 · 2 comments
Open

Django 1.7 migrations and format_filename #8

ryanbagwell opened this issue Jan 16, 2015 · 2 comments

Comments

@ryanbagwell
Copy link
Contributor

Django 1.7 won't make migrations with the format_filename function because it has an included function called 'upload_to', which it returns. When running makemigrations, Django attempts to serialize a path to 'upload_to,' which doesn't actually exist, and the command fails.

Django offers this explanation:

Please note that due to Python 2 limitations, you cannot serialize
unbound method functions (e.g. a method declared and used in the
same class body). Please move the function into the main module body
to use migrations. For more information, see
https://docs.djangoproject.com/en/1.7/topics/migrations/#serializing-values

I'm not sure what to do about this.

@matthewwithanm
Copy link
Contributor

@kenzic Didn't you fix this? Did you forget to push or am I thinking of something different?

@kenzic
Copy link

kenzic commented Jan 20, 2015

Yeah! @ryanbagwell you should use https://github.com/hzdg/django-upload-to for 1.7+. I'll bring it up at TWII. Thanks @matthewwithanm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants