Closed giobber closed 1 year ago
After discussion and some other tests, Member as User subclass is not the best way to manage situation In Admin User could be created inside Member page, Teacher should be free to be without a User The only lost feature is the possibility to see first_name, last_name and email as Member fields in admin table page but this is not a great loss
NOTE: first_name
and last_name
are removed from Member and make required as email
field
commit 809f2e9815010b7a1f220ad01fac54b9ff3deb60 closes this issues
One of the ways to extend a model in django is via inheritance, essentially when i subclass a model in django it create a hidden OneToOneField relation (unique=True, primary=True, null=False) by using Base class index as index for children.
For more info see Django Documentation
Pro
first_name
,last_name
andemail
now are set and accessed between User, Member and Teacher without useless complicationsContro
Sample code