Django

Code

Ticket #5252 (closed: duplicate)

Opened 3 years ago

Last modified 3 years ago

unexpected keyword argument max_length

Reported by: anonymous Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: unexpected keyword max_length
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

:)

Attachments

Change History

08/24/07 16:08:24 changed by Matt McClanahan <cardinal@dodds.net>

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to duplicate.
  • needs_tests changed.
  • needs_docs changed.

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/


Add/Change #5252 (unexpected keyword argument max_length)




Change Properties
Action