incase anyone cares, this is the solution I came up with. an initial query to filter for one condition, and then a for loop that checks that each member satisfies the second condition. hopefully, selected_related makes sure only one db call is made:
(in a function) books = Book.objects.filter(whateverconditions).distinct().select_related('transaction') incirc = [] for b in books: recenttran = b.transaction_set.order_by('-start_date')[0] if recenttran.recipient == self: incirc.append(b) -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.