Ultron/ultron/location/admin.py

36 lines
880 B
Python
Raw Normal View History

2021-12-09 16:53:44 +01:00
from django.contrib import admin
from .models import Place, Club, Country
class CountryAdmin(admin.ModelAdmin):
model = Country
2021-12-19 09:30:51 +01:00
list_display = ("name", "iso3", "iso2")
ordering = ("name",)
search_fields = ("name", "nationality")
2021-12-09 16:53:44 +01:00
class ClubAdmin(admin.ModelAdmin):
model = Club
2021-12-19 09:30:51 +01:00
list_display = ("name", "acronym", "place", "active")
ordering = ("name",)
list_filter = ("active",)
search_fields = ("name",)
autocomplete_fields = ("place",)
2021-12-09 16:53:44 +01:00
class PlaceAdmin(admin.ModelAdmin):
model = Place
2021-12-19 09:30:51 +01:00
list_display = ("name", "address", "postal", "city", "active")
ordering = ("name",)
list_filter = ("active",)
search_fields = ("name", "address", "postal", "city")
autocomplete_fields = ("country",)
2021-12-09 16:53:44 +01:00
admin.site.register(Place, PlaceAdmin)
admin.site.register(Club, ClubAdmin)
admin.site.register(Country, CountryAdmin)