I tried your second solution and it works fine!
Thanks!
On Jun 25, 4:51 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > 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
> > Attrib
Whoops...though I hate responding to my own post, I got things
backwards somehow (swapping details and headers). Your Details
have the header attribute so you want
since = datetime.date(2007,6,1)
details = Details.objects.filter(
code='123',
author='dave',
header__cre
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'
> 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 results (which you store in "d") are a QuerySet which is a
col
In my app I have two models like this:
class Header(models.Model):
code = models.CharField()
author = models.CharField()
class Detail(models.Model)
header = models.ForeignKey(Header)
creation_date = models.DateTime()
I need to find all the Header objects with a certain code, a c
5 matches
Mail list logo