Hello, I need to extend the Django User model in this way: I have an
Entity model an I want to define a relationship one-2-one from User to
Entity (so a Django User can be an Entity, but an Entity can be
something else).


So what's the best way to extend the User model for this particular
case??

I've read the 'official' ways to extend Django User model
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

and the Django book's way too:
http://www.djangobook.com/en/1.0/chapter12/#cn222

Iv'e read this one too
http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/

but can't decide on which one is the best for my case. The problem is
that I don't want to extend the User with a custom profile, I want to
extend my custom Entity model with User model, something like that
maybe works:

class MyUser(models.Model):
    user = models.ForeignKey(User, unique=True)
    entity = models.ForeignKey(Entity, unique=True)
    ....

Any opinions? Thanks in advance.
x13






-- 
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