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 may be making a bad assumption.

On Nov 13, 11: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 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