@bruno
Dint know that you can do lookups from OneToOne related models
Thanks
On Mon, Jan 16, 2012 at 8:00 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:
> On Jan 16, 8:04 am, Arun P wrote:
> > Does this work?
> >
> > info =
> >
> ExtraInformation.objects.filter(user__is_active
On Jan 16, 8:04 am, Arun P wrote:
> Does this work?
>
> info =
> ExtraInformation.objects.filter(user__is_active=1,user__is_staff=0,user__is_superuser=0).order_by("popularity").select_related("user")
>
> users = map(lambda i: i.user, info)
That was for the "uselessly complicated and memory-hungr
Does this work?
info =
ExtraInformation.objects.filter(user__is_active=1,user__is_staff=0,user__is_superuser=0).order_by("popularity").select_related("user")
users = map(lambda i: i.user, info)
Thanks
On Sun, Jan 15, 2012 at 1:05 AM, Swaroop Shankar V wrote:
> hello All,
> I have a model of
Thanks a lot Anler, that's exactly what I want. I never knew that it was so
simple.
Thanks and Regards,
Swaroop Shankar V
On Sun, Jan 8, 2012 at 4:36 PM, Anler wrote:
> Oh sorry, it should be this:
>
> photos = Photos.objects.filter(user__groups__id=the_group_id)
>
> --
> Anler
> Sent with S
Oh sorry, it should be this:
photos = Photos.objects.filter(user__groups__id=the_group_id)
--
Anler
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Sunday, January 8, 2012 at 12:04 PM, Anler wrote:
> Swaroop I think this is what you're asking for:
>
> photos = Photos.objects.fil
Swaroop I think this is what you're asking for:
photos = Photos.objects.filter(user__groups__name='admin')
--
Anler
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Sunday, January 8, 2012 at 11:42 AM, Jonas Geiregat wrote:
>
>
> > Thanks Jonas, the statements you had provided wo
> 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.
I would reco
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,
Swaro
> 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.
> 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.
10 matches
Mail list logo