Re: Traversing a backward relationship

2008-05-07 Thread Michael J
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

Re: Traversing a backward relationship

2008-05-07 Thread [EMAIL PROTECTED]
; > > 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 &

Re: Traversing a backward relationship

2008-05-06 Thread Eric Abrahamsen
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.

Re: Traversing a backward relationship

2008-05-06 Thread Dmitriy Kurilov
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

Traversing a backward relationship

2008-05-06 Thread Michael J
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