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 viewed_jobs(models.Model):
> job=models.ForeignKey(job)
> ...
>
> I would like to create a query that returns all jobs that have not
> been viewed - that is, those jobs for which there are no corresponding
> entries in viewed_jobs. I'm rather stuck with the model definitions as
> they are, for many reasons, and would like the database to do as much
> work as possible. Web research has shown some potential in the 'extra'
> QuerySet qualifier, but my noobness has defeated me. Grateful for any
> pointers.
>
> Ropz
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to