1👍
✅
poll.choice_set.all()
returns the entire set of Choice
s associated with the Poll
(via the Choice.poll
ForeignKey
). The choice
attribute is the CharField
within the Choice
model as described in part 1 of the tutorial. Using {{ choice }}
works since Choice.__unicode__()
is defined in part 1 as returning the value of the choice
field.
Source:stackexchange.com