On 6/25/07, ilDave <[EMAIL PROTECTED]> wrote: > So, I looked in the documentation and I found the 'FOO_set' Manager, > and I tried something like this: > > d = Details.objects.filter(creation_date__gte=datetime.date(2007, 06, > 01)) > d = d.header_set.filter(code__exact='123', author__exact='dave') > > but I get an > AttributeError: 'QuerySet' object has no attribute 'header_set'
The ForeignKey is on Detail, pointing at Header, which means that each Detail has only one Header -- hence there is no "header_set" on a Detail object. What you probably want instead is Detail.objects.filter(created_date__gte=datetime.date(2007, 6, 1), header__code__exact='123', header__author__exact='dave') -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---