python - Django 1.7 makemigrations - ValueError: Cannot serialize function: lambda -
python - Django 1.7 makemigrations - ValueError: Cannot serialize function: lambda -
i switch django 1.7. when seek makemigrations application, crash. crash study is:
migrations 'roadmaps': 0001_initial.py: - create model dataqualityissue - create model monthlychange - create model product - create model productgroup - create model recomendedstack - create model recomendedstackmembership - create model roadmapmarket - create model roadmapuser - create model roadmapvendor - create model specialevent - create model timelineevent - create model userstack - create model userstackmembership - add together field products userstack - add together field viewers userstack - add together field products recomendedstack - add together field product_group product - add together field vendor product - add together field product dataqualityissue traceback (most recent phone call last): file "manage.py", line 29, in <module> execute_from_command_line(sys.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute output = self.handle(*args, **options) file "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 124, in handle self.write_migration_files(changes) file "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 152, in write_migration_files migration_string = writer.as_string() file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 129, in as_string operation_string, operation_imports = operationwriter(operation).serialize() file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 80, in serialize arg_string, arg_imports = migrationwriter.serialize(item) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 245, in serialize item_string, item_imports = cls.serialize(item) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 310, in serialize homecoming cls.serialize_deconstructed(path, args, kwargs) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 221, in serialize_deconstructed arg_string, arg_imports = cls.serialize(arg) file "/usr/local/lib/python2.7/dist-packages/django/db/migrations/writer.py", line 323, in serialize raise valueerror("cannot serialize function: lambda") valueerror: cannot serialize function: lambda i found note here https://code.djangoproject.com/ticket/22892
there link documentation https://docs.djangoproject.com/en/dev/topics/migrations/#serializing-values
but not create clearer me. error meassage have not gave me clue problem.
is there way how observe line cause problem?
any hints?
we had issue using lambda in custom field definition.
it hard spot not listed in traceback , error not raised on particular model uses such custom field.
our way fix:
check custom fields (even in 3rd party libraries) change lambda callable, defined in module (i.e. not in custom field class) python django
Comments
Post a Comment