Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#1599 closed defect (fixed)

[magic-removal] tutorial01.txt: bugs in example of using the shell

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

Description

Line 508 and following:

p.choice_set.add(choice='Not much', votes=0)

Gives:
Traceback (most recent call last):

File "<console>", line 1, in ?

TypeError: add() got an unexpected keyword argument 'choice'

is wrong. Should probably be

p.choice_set.add(Choice(choice='Not much', votes=0))

c = p.choice_set.add(choice='Just hacking again', votes=0)
c.poll

Gives the error:
Traceback (most recent call last):

File "<console>", line 1, in ?

AttributeError: 'QuerySet' object has no attribute 'poll'

Even if changed to

c = p.choice_set.add(Choice(choice='Just hacking again', votes=0))[0]

c.poll

The error is
Traceback (most recent call last):

File "<console>", line 1, in ?

AttributeError: 'NoneType' object has no attribute 'poll'

Maybe add does not return a value??

Change History (1)

comment:1 Changed 9 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [2632]) magic-removal: Fixes #1599, Refs #1464 -- Updated all tutorials for new syntax, changes in manage.py, etc.

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