Couple things:

1) Your query is not working because if user1 added user2, then you
should be looking at from_friend not to_friend.

2) You haven't posted the code where you're creating friendships but
I'm assuming you are not creating symmetrical friendships there. That
is, if user1 adds user2, you create a record in the table and you move
on, but you need to create another record to symbolize the friendship
the other way around. Have a look at symmetrical ManyToMany
relationships and see if it's possible to go that route - it actually
uses a friends example :-)
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.symmetrical

Hope that helps.

--

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


Reply via email to