#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: | no | UI/UX: | no |
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??
(In [2632]) magic-removal: Fixes #1599, Refs #1464 -- Updated all tutorials for new syntax, changes in manage.py, etc.