Let's say I have a model "Friends" that looks something like:

class Friend(models.Model):
        user = models.ForeignKey(User)
        friend = models.ForeignKey(User, related_name="friend")

I want a list of "User" instances of a user's friends. Is my only
option to:

1) Get list of "Friends"
2) Then get list of "Users" where id in friends.value_llist('id')

Or is there a way to do a query on the "Friend" model and as to return
"User" instances of friends?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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