Re: Query for all objects in table1 that DO NOT have corresponding objects in table2

2008-11-15 Thread AndyH
You may want to think about the design of your models as well. Do you really need a separate model for viewed_jobs? Could it just be a boolean field on the Jobs model itself. Otherwise there's a danger of a lot of repetition between the two models. Of course, I don't know your exact use case, so I

Re: Query for all objects in table1 that DO NOT have corresponding objects in table2

2008-11-13 Thread Karen Tracey
On Thu, Nov 13, 2008 at 6:47 AM, Ropley <[EMAIL PROTECTED]> wrote: > > Noob question, but I've been running around in circles. I'm building > an in-house jobs board, and have 2 models: > > class jobs(models.Model): > ... > > class viewed_jobs(models.Model): > job=models.ForeignKey(job) > ... > > I

Re: Query for all objects in table1 that DO NOT have corresponding objects in table2

2008-11-13 Thread Alex Koshelev
Hi, Ropley! Try this: jobs.objects.exclude(viewed_jobs=True) On Thu, Nov 13, 2008 at 14:47, Ropley <[EMAIL PROTECTED]> wrote: > > Noob question, but I've been running around in circles. I'm building > an in-house jobs board, and have 2 models: > > class jobs(models.Model): > ... > > class view