Code

Opened 7 years ago

Closed 7 years ago

#5159 closed (duplicate)

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

Reported by: sarahman@… Owned by: jacob
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (0)

Change History (1)

comment:1 Changed 7 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

Dupe of #5119

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.