Ok, but our teacher showed us like this and I am really confused.
I do it like this and again when I click on some of the users in admin I have this error:
When I want to add
FieldError at /admin/accounts/appbaseuser/add/
Unknown field(s) (firs_name, last_name, is_active, position, date_joined) specified for AppBaseUser. Check fields/fieldsets/exclude attributes of class AppBaseUserAdmin
And when I click in the existing one:
this is how I do it now, I really can’t understand how to give permission in this situation. I don’t want to change users from the scratch. My code now:
@admin.register(UserModel)
class AppBaseUserAdmin(admin.ModelAdmin):
add_form= RegistrationAppUserForm
fieldsets = (
(
(
'Permissions',
{
'fields': (
'is_active',
'is_staff',
'is_superuser',
'groups',
'user_permissions',
),
},
),
(
'Personal info',
{
'fields': (
'firs_name',
'last_name',
'position',
),
},
),
(
'Important dates',
{
'fields': (
'last_login',
'date_joined',
),
},
),
))