Opened 6 years ago

Closed 6 years ago

#14839 closed (invalid)

django admin and user model inheritance

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: lists@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you extend the User model using inheritance for example:

class UserInfo(User):

....

if you give the delete permission on the UserInfo class you aren't able to delete a "UserInfo" object since you haven't the "can delete user object".

From a functional point of view if I extend the "User" class I want to see in the admin only the extended class and not the original "User" class so the delete permission on the "User" objects should be implicit if I give the delete permission on the UserInfo object.

Change History (1)

comment:1 in reply to:  description Changed 6 years ago by Julien Phalip

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: invalid
Status: newclosed

Replying to anonymous:

From a functional point of view if I extend the "User" class I want to see in the admin only the extended class and not the original "User" class so the delete permission on the "User" objects should be implicit if I give the delete permission on the UserInfo object.

Thanks for your suggestion. While this might be an interesting use case, this is not how inheritance and permissions are designed to work in Django. It seems that what you want to achieve could reasonably easily be done with a customised ModelAdmin class. If you need any help about this, I suggest you ask on the django user mailing list: http://groups.google.com/group/django-users/topics

Note: See TracTickets for help on using tickets.
Back to Top