Joe

Thanks for the info.

I'm going to redo the tutorial and see where I get.

John


On Mar 27, 4:33 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> > <<The vote() view is still required. However, it must be modified to
> > match the new templates and context variables. Change the template
> > call from polls/detail.html to polls/poll_detail.html, and pass object
> > in the context instead of poll.>>
>
> This change refers to the template file -
> [original stuff]
> <h1>{{ poll.question }}</h1>
> <ul>
> {% for choice in poll.choice_set.all %}
>     <li>{{ choice.choice }} -- {{ choice.votes }} vote{{ choice.votes|
> pluralize }}</li>
> {% endfor %}
> </ul>
>
> Where you might pass a poll object called {'poll':poll} before, with
> generic views, the object is called object or object_list - depending
> if the generic view is detail or list:
>
> {% if object %}
> # do something - object is this case is a poll object so
> {{ object.question}}  # works...
> {% endif %}
>
> {% if object_list %}
> {% for object in object_list %} # here object would be a poll object
> in a list
> do something like {{ object.question}}
> {% endfor %}
> {% endif %}
>
> Joe


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to