Thanks Jonas, the statements you had provided would give me a list of users who belong that group, but how can I retrieve the photos of those users? Actually I was looking for a single statement which would join all these tables and returns the data based on the Group ID.
Thanks and Regards, Swaroop Shankar V On Sun, Jan 8, 2012 at 2:34 PM, Jonas Geiregat <jo...@geiregat.org> wrote: > > > The user field is a foreign key to django auth User model. Each user is > assigned to a group (django Auth Group model). I want to retrieve all the > photos which belongs to users of a specific group. How can it be done? > > > from django.contrib.auth.models import Group > > group = Group.objects.get(name='your_group') > users = group.user_set.all() > > Haven't tested it, but I think that's what you want/need. > > > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.