Django

Code

Ticket #5159 (closed: duplicate)

Opened 1 year ago

Last modified 1 year ago

'max_length=200' should be replaced by 'maxlength=200' in part 1 of django tutorial

Reported by: sarahman@alum.mit.edu Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Hi,

In the following example from part 1 of the django tutorial, when I tried running 'python manage.py sql polls', I got a TypeError?: init() got an unexpected keyword argument 'max_length'. The error disappeared when I changed 'max_length=200' to 'maxlength=200'. Is this an error in the tutorial documentation?

Cheers,

Sabbir.


from django.db import models

class Poll(models.Model):

question = models.CharField?(max_length=200) pub_date = models.DateTimeField?('date published')

class Choice(models.Model):

poll = models.ForeignKey?(Poll) choice = models.CharField?(max_length=200) votes = models.IntegerField?()

Attachments

Change History

08/14/07 19:31:16 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.

Dupe of #5119


Add/Change #5159 ('max_length=200' should be replaced by 'maxlength=200' in part 1 of django tutorial)




Change Properties
Action