Opened 8 years ago

Closed 8 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: UI/UX:

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 Changed 8 years ago by Matt McClanahan <cardinal@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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