From 855ec1fe497b3f80b378c2dbae8cff898b0542fc Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Wed, 6 Sep 2017 12:55:24 +0200 Subject: Ajout des nouveaux champs et modèles à l’interface d’administration --- admin.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/admin.py b/admin.py index 2408623..156eef1 100644 --- a/admin.py +++ b/admin.py @@ -15,7 +15,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from django.contrib import admin -from .models import Timetable, LastUpdate, Group, Subscription, Room, Course +from .models import Timetable, LastUpdate, Group, Subscription, Room, Course, CourseDelta @admin.register(Timetable) @@ -54,9 +54,19 @@ class RoomAdmin(admin.ModelAdmin): @admin.register(Course) class CourseAdmin(admin.ModelAdmin): fieldsets = ( - (None, {"fields": ("name", "type", "timetable", "groups", "rooms",)}), + (None, {"fields": ("name", "type", "timetable", "groups", "rooms", "active",)}), ("Horaires", {"fields": ("begin", "end",)}), ("Remarques", {"fields": ("notes",)}),) - list_display = ("name", "type", "timetable", "begin", "end",) - list_filter = ("type", "timetable__name", "groups",) + list_display = ("name", "type", "timetable", "begin", "end", "active",) + list_filter = ("type", "timetable__name", "groups", "active",) ordering = ("begin",) + + +@admin.register(CourseDelta) +class CourseDeltaAdmin(admin.ModelAdmin): + fieldsets = ( + (None, {"fields": ("course", "update", "operation",)}), + ) + list_display = ("course", "update", "operation",) + list_filter = ("operation",) + ordering = ("update",) -- cgit v1.2.1