Hi, I've got a UserProfile model:-
class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) ... friends = models.ManyToManyField(User, related_name='friend', blank=True) ... I'm trying to do a query which will return all the users who call a given user a 'friend', i.e. if Bob and Jane have marked Dave as their friend, I want to return Bob and Jane as being 'fans' of Dave. Hope that makes sense. I've tried various things, including:- fans = UserProfile.objects.filter(friends__friend=user) fans = User.objects.filter(friend=user) where user is the 'Dave' user object, but they are giving spurious results. Can anyone help me out? Regards, Andrew --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---