Opened 11 years ago

Closed 11 years ago

#5252 closed (duplicate)

unexpected keyword argument max_length

Reported by: anonymous Owned by: Jacob
Component: Documentation Version: master
Severity: Keywords: unexpected keyword max_length
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I got the following error:

testsite.polls: init() got an unexpected keyword argument 'max_length'
1 error found.
Traceback (most recent call last):

File "", line 11, in <module>


File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/", line 1672, in execute_manager

execute_from_command_line(action_mapping, argv)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/", line 1620, in execute_from_command_line

mod_list = [models.get_app(app_label) for app_label in args[1:]]

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/", line 40, in get_app

mod = load_app(app_name)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/", line 51, in load_app

mod = import(app_name, {}, {}, models?)

File "/Library/webserver/django/testsite/../testsite/polls/", line 10, in <module>

class Choice(models.Model):

File "/Library/webserver/django/testsite/../testsite/polls/", line 12, in Choice

choice = models.CharField(max_length=200)

TypeError: init() got an unexpected keyword argument 'max_length'
kimmings-computer:/library/webserver/django/testsite julian$ python sql polls

when using the line below from above
python sql polls

... after search the docs I found this page - - which uses maxlength keyword, not max_length.
after changing the keyword everything worked fine.

in instaled on
mac osx10.4 using mysql-python-1.2.2 mysql5 django0.96


Change History (1)

comment:1 Changed 11 years ago by Matt McClanahan <cardinal@…>

Resolution: duplicate
Status: newclosed

The argument was recently changed to max_length in the trunk version. See #2101 and [5803].

If you are using Django 0.96, the documentation you should use is

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