Hi guys, thanks for responding. I didn't want to have to create 2
entries in the database for a friendship because of the obvious
integrity issues such as friendship deleting and friendship
relationships to files etc.... seems like a lot of unnecessary
duplication. I didn't see that symmetrical m2m before, thanks a lot
for the link. I am going to refactor my code and schema armed with
this information.

J


On Dec 2, 5:39 pm, aa56280 <aa56...@gmail.com> wrote:
> 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.mod...
>
> 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