aboutsummaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-06 12:55:24 +0200
committerAlban Gruin2017-09-06 12:55:24 +0200
commit855ec1fe497b3f80b378c2dbae8cff898b0542fc (patch)
tree54ce621935832bac0124da88955de2b424b1cffd /admin.py
parentfe99bdc1bbaa615fbef0c4ced8e3f25a0a110b11 (diff)
Ajout des nouveaux champs et modèles à l’interface d’administration
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py18
1 files 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",)