Skip to content

Django 1.7 migrations and format_filename #8

@ryanbagwell

Description

@ryanbagwell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions