SmileyChris wrote: > How about just making the query like this: > > A.objects.filter(b__status=1)
This returns the list of rows in table A that have status in table B set to 1 at some point in the past. What I want is the latest status from table B. For example, if table B has the two entries: B(id=1, a=1, status=1, date=yesterday) and B(id=2, a=1, status=0, date=today) a = 1 should not be returned in the list, because the current status is 0. Suriya --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---