I have a "poem" model that belongs to "user". The "poem" model an
"approved" attribute. I want to print a list of users and display only
their poems that are approved.
What do I specify in the Queryset to make this work?
I want to do something like this:
u = User.objects.filter(poem.approved=True)
But that obviously is the incorrect syntax.
model:
class Poem(models.Model):
title = models.CharField('Title', maxlength=127)
body = models.TextField('Body Text')
approved = models.NullBooleanField()
user = models.ForeignKey(User)
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---