I have an app, and I have added 3 Users in 2 Groups.
How do I get the users that belong to a specific Group??

Using the shell on the built in Django models I get:
>>> G = Groups.objects
>>> U = Users.objects
>>> U.all()
[<User: User:art>, <User: User:joe>]
>>> G.all()
[<Group: Admin>, <Group:Author>]

Ok so far?  ( the double User: in U.all() concerns me a bit)

>>>U.all().filter(groups__id = 1)
[<User: User:art>]
>>>U.all().filter(groups__id = 2)
[<User: User:joe>]

Makes sense- I've used the admin to put one user in each group.


>>>U.all().filter(groups__name = 'Admin')
[<User: User:art>, <User: User:joe>]

??? Why both users???
Shouldn't this give me a list of the Users in the 'Admin' group?

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