Daniel,

{% for author in review.item.author_set.all %}
Is what I've been using.

TINo, no errors at all, it just doesn't display.
Agreed it is a ManyToMany type. Am thinking perhaps a ForeignKey type
may work just fine. Any reason you guys can think of that an Author
field should be a ManyToMany?


d


- - -

On Jul 3, 12:13 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jul 2, 2:55 pm, The Danny Bos <danny...@gmail.com> 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 django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to