Re: Adding Objects to Query Set
Hi
I am working on the same thing. Same here, one project model, one extended User model. Well, when I printed the request, I got the Usename, which is not an id, but you'd like to compare ids. Is that correct?
So perhaps you're closer to a solution, if you have a method like this:
def get_queryset(self):
return Project.objects.filter(owner=self.request.user.id) <-- see that id?
return Project.objects.filter(owner=self.request.user.id) <-- see that id?
Best regards,
Sebastian
Sebastian
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9dec582e-41c0-47b1-a9ed-65850eac8585%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home