Thanks; this works for me -- though I have to do
Author.objects.filter(story__id__isnull=False).distinct()
Or it repeats each author for each of his stories.
This still confuses me, because there is no "story" field in the Author
model to specify how to do the join (Author:Story is One:Many, so I
just put a foreign key in the Story model). I guess it is inferring
the Join conditions by looking at the Story model. But what if I had
two Story-Author relations, say:
class Story (models.Model) :
author = ForeignKey(Author)
editing_author = ForeginKey(Author)
How could it possibly know which one I wanted to join on?
Cheers,
G
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---