Opened 17 years ago

Closed 17 years ago

#5252 closed (duplicate)

unexpected keyword argument max_length

Reported by: anonymous Owned by: Jacob
Component: Documentation Version: dev
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

Description

I got the following error:

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

File "manage.py", line 11, in <module>

execute_manager(settings)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management.py", 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/management.py", 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/loading.py", 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/loading.py", line 51, in load_app

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

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

class Choice(models.Model):

File "/Library/webserver/django/testsite/../testsite/polls/models.py", 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 manage.py sql polls

when using the line below from above
python manage.py sql polls

... after search the docs I found this page - http://www.djangoproject.com/documentation/0.96/models/lookup/ - 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 by Matt McClanahan <cardinal@…>, 17 years ago

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 http://www.djangoproject.com/documentation/0.96/

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