Are you using the built-in Group and User classes? If what you are quoting is cut-and-pasted from your console, you maybe using your own model? Maybe you should show us the actual source code.
FYI -- the built-in classes are django.contrib.auth.models.Group and ..User not Groups nor Users P>P.K. On Dec 20, 11:13 am, kbochert <[EMAIL PROTECTED]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---