> u = User.objects.filter(poem_set__approved=True)

I think you meant: u = User.objects.filter(poem__approved=True)

> and then in your template, you can have something like
>
>  {% for user in users %}
>    <h1>User: {{ user }}</h1>
>    {% for poem in user.poems %}
>      {% if poem.approved %}
>       <p>{{ poem.title }}
>      {% endif %}
>    {% endfor %}
>  {% endfor %}

I would like to do something like that, but I don't want to filter the
approved poems in the template. I want to filter them in the view.
(Thank for your help though!)




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to