Alright thanks a lot.

On Dec 22, 3:06 pm, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On 22 déc, 17:10, kev <kevinri...@gmail.com> wrote:
>
>
>
> > Hello,
> > Im reading a django book and it adds friends to user authentication
> > system by making:
>
> > (was .96)
>
> > class Friendship(models.Model):
> >   from_friend = models.ForeignKey(
> >     User, related_name='friend_set'
> >   )
> >   to_friend = models.ForeignKey(
> >     User, related_name='to_friend_set'
> >   )
> >   def __str__(self):
> >     return '%s, %s' % (
> >       self.from_friend.username,
> >       self.to_friend.username
> >     )
> >   class Admin:
> >     pass
> >   class Meta:
> >     unique_together = (('to_friend', 'from_friend'), )
>
> > But for this to work, you have to add friendship both ways.
>
> Nope. You have to *query* it both ways.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to