2021-12-09 16:53:44 +01:00
|
|
|
from django.contrib import admin
|
|
|
|
from .models import Gymnast
|
|
|
|
|
|
|
|
|
|
|
|
class GymnastAdmin(admin.ModelAdmin):
|
|
|
|
model = Gymnast
|
|
|
|
|
|
|
|
fields = (
|
2021-12-19 09:30:51 +01:00
|
|
|
"last_name",
|
|
|
|
"first_name",
|
|
|
|
"birthdate",
|
|
|
|
"gender",
|
|
|
|
"trainings_by_week",
|
|
|
|
"hours_by_week",
|
|
|
|
"is_active",
|
2021-12-17 09:44:28 +01:00
|
|
|
# 'club'
|
2021-12-09 16:53:44 +01:00
|
|
|
)
|
|
|
|
|
2021-12-19 09:30:51 +01:00
|
|
|
list_display = ("last_name", "first_name", "age", "is_active") # , 'club'
|
|
|
|
list_filter = ("gender", "is_active") # , 'club'
|
|
|
|
search_fields = ("last_name", "first_name")
|
2021-12-17 09:44:28 +01:00
|
|
|
# autocomplete_fields = ('club',)
|
2021-12-09 16:53:44 +01:00
|
|
|
|
2021-12-19 09:30:51 +01:00
|
|
|
|
2021-12-09 16:53:44 +01:00
|
|
|
admin.site.register(Gymnast, GymnastAdmin)
|