I've had this working in raw SQL, but I'm refactoring and trying to
django-ify things a little bit. I thought it would be simple, but I'm
stuck.

I have a Post model and a Rating model.

The Rating model has a one-to-many relationship with Post, a
one-to-many relationship with User, and a score. (So it's basically a
m2m table with extra data)

I'm trying to get all Posts that don't have a rating by a specific
User.

Post.objects.filter(rating__user = user) mostly works, but it excludes
all Posts that have not been rated by any users yet (don't have rows in
the Rating table).

Any way to do this in Django?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to