Hello,

I have successfully used OneToOne relationships for inheritance, this
is pretty well documented on the official doc and the result on admin
site is very elegant.
But I cannot use OneToOne field on another simple case : the marriage
case.
The goal is to link 2 objects of the same type together, for example 2
persons which are married.
I tried this very simple model :

class Person(models.Model):
        name = models.CharField(max_length=100)
        married_to = models.OneToOneField('self', blank = True, null =
True)
        def __unicode__(self):
                return self.name
        class Admin:
                pass

I have several problems on the admin site with this model :
-I cannot change 'married_to' field after object creation.
-The OneToOne relationships is not symmetrical as it should be. When I
create Paul married_to Laura, Laura is not automatically married_to
Paul.

I am using today 0.97 trunk SVN version.

Can anybody help me with this model or propose another one ?
Thanks !

Ciao.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to