diff options
author | Alban Gruin | 2017-09-06 12:55:24 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-06 12:55:24 +0200 |
commit | 855ec1fe497b3f80b378c2dbae8cff898b0542fc (patch) | |
tree | 54ce621935832bac0124da88955de2b424b1cffd | |
parent | fe99bdc1bbaa615fbef0c4ced8e3f25a0a110b11 (diff) |
Ajout des nouveaux champs et modèles à l’interface d’administration
-rw-r--r-- | admin.py | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -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",) |