Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18765 closed Bug (needsinfo)

tutorial01 missed step (poll save)

Reported by: evanda@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

When adding choices to the poll it is suggested that the choice can tell you its API:

>>> c = p.choice_set.create(choice_text='Just hacking again', votes=0)

# Choice objects have API access to their related Poll objects.
>>> c.poll
<Poll: What's up?>

But that does not work - you must save the poll after adding the choices before it appears. Just add:

p.save()

In there after the choice_set.create() call.

Change History (4)

comment:1 by anonymous, 12 years ago

That first line should read:
"the choice can tell you its Poll via API:"

comment:2 by Simon Charette, 12 years ago

Resolution: needsinfo
Status: newclosed

What do you mean by it doesn't work? Does it trigger an exception? If so please provide a traceback.

Marking as needsinfo until you provide requested information.

in reply to:  2 comment:3 by anonymous, 12 years ago

Replying to charettes:

What do you mean by it doesn't work? Does it trigger an exception? If so please provide a traceback.

Marking as needsinfo until you provide requested information.


I am nearly positive that the first time it returned nothing from the c.poll() call -- that it wasn't associated with its parent poll until after I saved the poll. However upon retrying it appears to have worked perfectly as documented - consider it my mistake, and apologies.

comment:4 by Simon Charette, 12 years ago

No problems :)

Thanks for reporting anyway!

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