Ultron/ultron/people/admin.py

26 lines
582 B
Python
Raw Normal View History

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",
# '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")
# 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)