#12681 closed (duplicate)
Make User model site business logic agnostic
Reported by: | Emanuele Bertoldi | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.1 |
Severity: | Keywords: | user auth profile login registration | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In my opinion the default User model (contrib.auth) isn't generic enough to work with all generic web applications.
My idea is to remove filename, lastname and email fields from the User model and add a default Profile model which includes them.
In this way the User model implements only the auth logic (username, password, ...) while the specific site business logic for accounts could be implemented in a custom Profile model.
A practical example:
I want to develop a CRM: I've a partner class with zero or more contacts. Some of these contacts may have an account to the CRM. Now imagine each contact has firstname, lastname and email fields, we have a obvious collision between contact and user fields.
Duplicate of #3011