Reputation: 6667
Am on Django 1.6
In my app I'd like to have a User object and a separate profile object. I'd like to avoid implementing a custom User object and instead just use a one-to-one relation to a model that has all the additional fields/info I want.
Whenever I do a query on a User object, 90% of the time I will want to retrieve this profile object. My thinking is that the best way to do this is to modify the get_queryset method of the default UserManager to always retrieve this related object via a "select_related" call.
Is there a way to do this?
Searching around this is the only resource i could find on the topic.
Override Django User Manager to only return active users in queries
Do I need to do it this way? Can I instead just somehow use the base User object?
Thanks in advance.
Upvotes: 0
Views: 403
Reputation: 9097
Since Django 1.5 you can create your custom user model. This eliminates the need of user_profile
.
Upvotes: 2