ilter(jobs__pk__gt=0)
>
> > > Is it?
>
> > > -Original Message-
> > > From: Michael J <[EMAIL PROTECTED]>
> > > To: Django users
> > > Date: Tue, 6 May 2008 16:29:20 -0700 (PDT)
> > > Subject: Traversing a backward relations
;
> > class Job(models.Model):
> > city = models.ForeignKey(City, related_name="jobs")
> > # Other fields
>
> > # views
> > City.objects.filter(jobs__pk__gt=0)
>
> > Is it?
>
> > -Original Message-----
> > From: Michael J &
PROTECTED]>
> To: Django users
> Date: Tue, 6 May 2008 16:29:20 -0700 (PDT)
> Subject: Traversing a backward relationship
>
>>
>>
>> I hope this isn't a stupid question, so forgive me in advance.
>>
>> I have a Job model and a City model.
To: Django users
Date: Tue, 6 May 2008 16:29:20 -0700 (PDT)
Subject: Traversing a backward relationship
>
>
> I hope this isn't a stupid question, so forgive me in advance.
>
> I have a Job model and a City model. Job and City are linked via a
> ForeignKey in Job. On the we
I hope this isn't a stupid question, so forgive me in advance.
I have a Job model and a City model. Job and City are linked via a
ForeignKey in Job. On the website, users will select a city, from a
list of cities, and then see the corresponding jobs.
Question is: how do I use the database API to
5 matches
Mail list logo