I got a models which is as follows:
class Photos(models.Model):
"""
This model will enable the users to upload photos
"""
user = models.ForeignKey(User)
title = models.CharField(_('Title'), max_length=250, null = True, blank = True)
description = models.TextField(_('Description'), null = True, blank = True)
image = models.ImageField(_('Image'), upload_to=get_image_path)
created_on = models.DateTimeField(auto_now_add = True)
updated_on = models.DateTimeField(auto_now = True)
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?
Thanks and Regards,
Swaroop Shankar V
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 comments:
Post a Comment