Opened 5 years ago

Closed 5 years ago

#23255 closed Uncategorized (worksforme)

Migrations fail with custom models.Field

Reported by: django@… Owned by: nobody
Component: Migrations Version: 1.7-rc-2
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Follow the example at

and try to run ./ migrate

The following exception is given:

Traceback (most recent call last):
  File "./", line 10, in <module>
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/core/management/", line 385, in execute_from_command_line
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/core/management/", line 377, in execute
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/core/management/", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/core/management/", line 337, in execute
    output = self.handle(*args, **options)
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/core/management/commands/", line 153, in handle
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/db/migrations/", line 104, in from_apps
    model_state = ModelState.from_model(model)
  File "/Users/patrick/.virtualenvs/migr/lib/python2.7/site-packages/django/db/migrations/", line 181, in from_model
TypeError: Couldn't reconstruct field field1 on migr2.MyModel: __init__() got multiple values for keyword argument 'verbose_name'

See my example project at
and run ./ migrate to reproduce

Change History (1)

comment:1 Changed 5 years ago by Baptiste Mispelon

Resolution: worksforme
Status: newclosed


Your code incorrectly passes self when calling the super(...) in __init__:

super(MyField, self).__init__(self, *args, **kwargs)

Should be:

super(MyField, self).__init__(*args, **kwargs)

(as is documented)


Note: See TracTickets for help on using tickets.
Back to Top