Hello,

I have a problem for a quite simple model.
I would like to model a person marriage relation.

example :

class Person(models.Model):
        name=models.CharField(max_length=100)
        married_to=models.OneToOneField('self',symmetrical=True) #
symmetrical not allowed
        married_to=models.ForeignKey
('self',unique=True,symmetrical=True) # symmetrical not allowed
        married_to=models.ManyToManyField
('self',unique=True,symmetrical=True) # unique not allowed

The relation I want has to be unique and symmetrical.
Someone can only be married to one other person (unique).
If Alice is married to Bob, then Bob is automatically married to Alice
(symmetrical).

How would you model this relation ?
Thanks.

Regards,
Aldo
--~--~---------~--~----~------------~-------~--~----~
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