> Given your view code above, what would the template code look like to
> return something like this:
> 
> object | tags
> -------+----------
>   obj1  | food, meat
>   obj2  | food, meat
>   obj3  | food
>   obj4  | food, cake
>   obj5  | food, cake
>   obj6  | food, vegetable
>   obj7  | garden, vegetable

you'd simply iterate over the resulting Obj's and then iterate 
over its tags:

  <table>
   <tr><th>object</th><th>tags</th></tr>
   {% for obj in objs %}
   <tr>
     <td>{{ obj }}</td>
     <td>
      {% for tag in obj.tag_set %}
       {{ tag }}{% if forloop.last %}{% else %}, {% endif %}
      {% endfor %}
     </td>
   </tr>
   {% endfor %}
  </table>

My code doesn't change anything but how "objs" gets populated or 
how the template displays "objs"

-tim




--~--~---------~--~----~------------~-------~--~----~
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