Make User model site business logic agnostic
|Reported by:||Emanuele Bertoldi||Owned by:||nobody|
|Severity:||Keywords:||user auth profile login registration|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.