Hi,
On Wednesday, March 11, 2015 at 3:50:31 AM UTC-4, elpaso wrote:
-- I'd personally recommend re-using the same model and having a "type" field for whether it's corporate or private.
Otherwise, you'd need to do something like:
class Corporate(models.Model):
user = models.OneToOneField(User)
class Private(models.Model):
user = models.OneToOneField(User)Then, you would need to try to query for the profile. Something like:
try:
corporate = request.user.corporate
except Corporate.DoesNotExist:
corporate = NoneCollin
On Wednesday, March 11, 2015 at 3:50:31 AM UTC-4, elpaso wrote:
Hi,
I've used custom user profiles in the past, but they were associated
to all users, now I need to associate a different custom profile for
each user group (for example: "corporate", "private").
Any hint about the best approach?
--
Alessandro Pasotti
w3: www.itopen.it
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/56237ed7-f3e2-4835-bfea-93226b17199e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment