@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
hello All,
I have a model of following structure
class ExtraInfomration():
user = models.OneToOneField(User)
total_likes = models.IntegerField(_('Total Likes'), null=True, blank=True,
default=0)
total_dislikes = models.IntegerField(_('Total Dislikes'), null=True,
blank=True, default=0)
popularity
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.
Hi,
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(_('Des
12 matches
Mail list logo