14 lines
506 B
Python
14 lines
506 B
Python
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from .models import User
|
|
|
|
|
|
@admin.register(User)
|
|
class CustomUserAdmin(UserAdmin):
|
|
list_display = ('username', 'full_name', 'role', 'phone', 'region', 'is_staff')
|
|
list_filter = ('role', 'is_staff', 'is_active')
|
|
search_fields = ('username', 'full_name', 'phone', 'email')
|
|
fieldsets = UserAdmin.fieldsets + (
|
|
('Профиль', {'fields': ('role', 'full_name', 'phone', 'birth_date', 'region')}),
|
|
) |