You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
from django.contrib import admin
|
|
from .models import Club, Tournament, CustomUser, Event, Round, GroupStage, Match, TeamState, TeamRegistration, PlayerRegistration
|
|
from django.contrib.auth.admin import UserAdmin
|
|
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
|
|
|
from .forms import CustomUserCreationForm, CustomUserChangeForm
|
|
|
|
|
|
class CustomUserAdmin(UserAdmin):
|
|
form = CustomUserChangeForm
|
|
add_form = CustomUserCreationForm
|
|
model = CustomUser
|
|
list_display = ["email", "username", "umpire_code"]
|
|
fieldsets = [
|
|
(None, {"fields": ["username", "email", "password", "club", "umpire_code"]}),
|
|
]
|
|
add_fieldsets = [
|
|
(
|
|
None,
|
|
{
|
|
"classes": ["wide"],
|
|
"fields": ["username", "email", "password1", "password2", "club", "umpire_code"],
|
|
},
|
|
),
|
|
]
|
|
|
|
admin.site.register(CustomUser, CustomUserAdmin)
|
|
admin.site.register(Club)
|
|
admin.site.register(Event)
|
|
admin.site.register(Round)
|
|
admin.site.register(GroupStage)
|
|
admin.site.register(Match)
|
|
admin.site.register(TeamState)
|
|
admin.site.register(TeamRegistration)
|
|
admin.site.register(PlayerRegistration)
|
|
|