mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 12:19:24 +08:00
16 lines
421 B
Python
16 lines
421 B
Python
from django import forms
|
|
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
from .models import CustomUser
|
|
|
|
|
|
class CustomUserAdmin(UserAdmin):
|
|
model = CustomUser
|
|
list_display = ('id',) + UserAdmin.list_display
|
|
# Editable fields per instance
|
|
fieldsets = UserAdmin.fieldsets + (
|
|
(None, {'fields': ('avatar',)}),
|
|
)
|
|
|
|
|
|
admin.site.register(CustomUser, CustomUserAdmin)
|