26 lines
736 B
Python
26 lines
736 B
Python
from django.contrib import admin
|
|
|
|
from .models import Groep, Persoon, Subgroep
|
|
|
|
|
|
@admin.register(Groep)
|
|
class GroepAdmin(admin.ModelAdmin):
|
|
list_display = ("naam", "omschrijving", "actief")
|
|
list_filter = ("actief",)
|
|
search_fields = ("naam",)
|
|
|
|
|
|
@admin.register(Persoon)
|
|
class PersoonAdmin(admin.ModelAdmin):
|
|
list_display = ("achternaam", "voornaam", "rol", "groep", "actief")
|
|
list_filter = ("rol", "actief", "groep")
|
|
search_fields = ("voornaam", "achternaam")
|
|
autocomplete_fields = ("groep",)
|
|
|
|
|
|
@admin.register(Subgroep)
|
|
class SubgroepAdmin(admin.ModelAdmin):
|
|
list_display = ("naam", "omschrijving", "actief")
|
|
list_filter = ("actief",)
|
|
search_fields = ("naam",)
|
|
filter_horizontal = ("leden",)
|