On Jul 2, 2:55 pm, The Danny Bos <[email protected]> wrote:
> K, I think I have it.
>
> Just having trouble getting the Author loop from within my Review
> set.
> Here's what I have below, I figured this was pretty close but I'm
> wrong aren't I?
>
>         {% for review in reviews_full %}
>                 <a href="">{{ review.item.title }}</a><br/>
>                 {{ review.item.publisher.name }}<br/>
>
>                 {% for author in review.item.author_set.all %}
>                         {{ author.name }},
>                 {% endfor %}
>
>                 {{ review.pream }}
>         {% endfor %}
>
> Any ideas would be great.
> Hope the above makes some sense ...
>
> d

Should be:
{% for author in review.item.author_set.all %}
because the link from book to authors is a manytomany relationship,
not a backwards foreign key (which is when you use *_set).
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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