> be quick and easy. If Joe adds Murray as a friend, and
> uses the pre- filled description "We worked together" when
> adding him, Murray simply wants to be able to press
> "Confirm", and the relationship is set up on both their
> profiles. This is where the symmetrical M2M is really
> handy - it doesn't rely on two separate fields in the
> table. The friendship on both sides is easily extracted
> through something like
>
> v = Profile.objects.get(user=request.user)
> v.friends.all()
Have you experimented the solution I provided?
If you want something like this, you can easily tweak the
models. You can do something like
class Association(Model):
person = ForeignKey(Person, related_name='friend_of')
associate = ForeignKey(Person, related_name='friends')
relationship = ForeignKey(Relationship)
reciprocal = BooleanField(null=True,blank=True,default=None)
Thus, you can find out the list of people who are friends of
X where person X hasn't declared whether the relationship is
reciprocal:
p = Person.objects.get(id=42)
for a in Association.objects.filter(
associate=p).filter(
reciprocal__isnull=True)
print a.person, ' thinks I am a ', a.relationship
print "but I haven't said whether the opposite is the case"
You can then either set "reciprocal" to True or False based
on whether the user accepts the invitation, or you can
create another Association object with the backwards
information pre-populated. Either method would serve as
your "confirm" aspect of things...the value starts out set
to Null. The user is prompted about it until they choose
one way or the other.
-tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---