Opened 3 years ago

Closed 3 years ago

Last modified 3 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 Changed 3 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 follow-up: Changed 3 years ago by charettes

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

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.

comment:3 in reply to: ↑ 2 Changed 3 years ago by anonymous

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 Changed 3 years ago by charettes

No problems :)

Thanks for reporting anyway!

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