Working with Django docs’ sample Blog and Entry models, how would one get a queryset of all Blog objects that have name = "a" and that are not associated with any instance of the Entry model?
In raw (My)SQL terms, what is the Django ORM equivalent of:
SELECT * FROM blog_table bt
WHERE bt.name='a' AND bt.id NOT IN (SELECT et.blog_id FROM entry_table et)
What you need is a list of
Bloginstances that havename = "a"and do not have any associated entries. You can do this by: