I have an agreement model that can be "amended" using a relationship
to itself. I need to get a queryset of the active agreements for a
certain time period but the following query does not work i believe
because of the way the Django orm handles joins. Can this query be
expressed using the Django orm?

return self.exclude(Q(date_effective__gt=dtuntil) |
                            Q(date_expires__lt=dtstart) |
                            Q(date_terminated__isnull=False)) \
                   .filter(Q(amendment__isnull=True) |
                           Q(amendment__date_effective__gt=dtstart))

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

Reply via email to