Hi,

I have a Profile model with a OneToOne relationship to the auth.User
model.
In the Profile I have a ManyToMany relationship (non-symmetrical) to
the auth.User model called friends.

Something like this:
class Profile(models.Model):
    user = models.OneToOneField(auth.models.User)
    friends = models.ManyToManyField(auth.models.User, null=True,
blank=True, related_name='friends')

I need to list the Users, with the possibility of using two filters:
my friends and people who added me.

I can list people who added me using:
users = auth.models.User.filter(profile__friends=some_user_id)

But I can't get the list of people I added using a lookup, and I can't
just use the 'friends_set' method because I may need to combine the
two filters.

Anyone can help me?

Best regards,
Enrico


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to