The best I've been able to come up with is:

qs1 = Blog.objects.all()
qs2 = qs1.filter(entry__blog__isnull=False)
qs3 = filter(lambda x: x not in qs2, qs1)

Surely there is a better method.


On Feb 7, 1:02 pm, grahamu <[EMAIL PROTECTED]> wrote:
> Using the conventional Blog and Entry models from the Django database
> API docs:
>
>     class Blog(models.Model):
>         name = models.CharField(max_length=100)
>         ...
>
>     class Entry(models.Model):
>         blog = models.ForeignKey(Blog)
>         headline = models.CharField(max_length=255)
>         ...
>
> How can one retrieve a queryset of Blogs with no Entries?
--~--~---------~--~----~------------~-------~--~----~
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