Hi!
I'm trying to use different types of profiles on django 1.4, I basically followed this :
https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
The thing is that the docs only apply if you have one profile type, and i have four. Doing
some research i found that setting a base profile and inheriting from it you can can get multiple
profile types. So this is what I did :
class HomesUserProfile(models.Model):
user = models.OneToOneField(User)
class AgentProfile(HomesUserProfile):
homes_user = models.OneToOneField(HomesUserProfile)
agency = models.ForeignKey(Agency, verbose_name='Agencia')
branch = models.ForeignKey(Branch, verbose_name='Sucursal')
class AuditorProfile(HomesUserProfile):
homes_user = models.OneToOneField(HomesUserProfile)
agency = models.ForeignKey(Agency, verbose_name='Agencia')
and then :
AUTH_PROFILE_MODULE = 'homes.HomesUserProfile'
class UserAdmin(contrib_auth.UserAdmin):
inlines=(AgentProfileInline, AuditorProfileInline)
The thing is that now the only profile that ever gets created when creating a user
is AgentProfile. I can't get it to create an AuditorProfile not even by setting the agency
field on the form.
Any ideas what is going on? I'm clueless
Thanks!
--
Nicolas Emiliani
Lo unico instantaneo en la vida es el cafe, y es bien feo.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment