From daa35602eeee6b15cea2b4e92a0556de2a1b4905 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 7 Sep 2017 22:50:12 +0200 Subject: Le champ slug du modèle Year est auto-rempli Correction du filtre des emplois du temps --- admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin.py b/admin.py index 1493b0f..b244eb3 100644 --- a/admin.py +++ b/admin.py @@ -20,14 +20,15 @@ from .models import Timetable, LastUpdate, Group, Subscription, Room, Course, Ye @admin.register(Year) class YearAdmin(admin.ModelAdmin): - pass + prepopulated_fields = {"slug": ("name",)} + list_display = ("name",) @admin.register(Timetable) class TimetableAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("name",)} list_display = ("name", "year", "url",) - list_filter = ("year",) + list_filter = ("year__name",) @admin.register(LastUpdate) -- cgit v1.2.1