On Fri, 4 Apr 2008, josesoa wrote:

> Something like this should do the trick...
>
> Events.objects.filter(brags__isnull=False)

Thanks!!!  That pointed me in the right direction.  But, it created a 
QuerySet where, for example, if an event had five brags five copies of the 
that event were included in the QuerySet.  Adding a .distinct() got me 
where I needed to be.  I just wanted to mention it in case it might help 
others following this thread.  My results looked something like:

e1 = Events.objects.filter(brags__isnull=False)

e1.Count()

1961L

e2 = Events.objects.filter(brags__isnull=False).distinct()

e2.Count()

150L



Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!


--~--~---------~--~----~------------~-------~--~----~
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