(re-sending, apologies if this hits the list twice)
On Mar 24, 5:27 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote:
> What is it you want to do with the ones they've voted on vs. haven't? If
> you're going to hide the ones they've already voted on, just write a
> query in the view method that only returns those and pass that to the
> context. (Note: the view method, not the template. See Ivan's response.)
I thought I'd go this route -- it seemed simplier and more useful.
However, I can't seem to work out the query. My initial attempt:
def pending(request):
return object_list(request,
Paper.objects.exclude(vote__user=request.user))
However this appears to joining Paper and Vote, filtering out the rows
where I voted, and then showing the rows remaining (which leads to
duplicates).
What would the correct filter be for all Papers which don't have a
related Vote object with a given user field?
Thanks,
Ross
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---