aboutsummaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-19 13:51:46 +0100
committerAlban Gruin2017-01-19 13:51:46 +0100
commite9d4b61b1fb0d5efa78df56a2529185d3d8fabf5 (patch)
tree23e5bc9abdfdcf1e4db9b9d6f6c7635715a87b4d /admin.py
parent7855fc164a16e0303f3d9aa7ee5c2ee9c719b4de (diff)
Association des cours et groupes à des emplois du temps spécifiques
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/admin.py b/admin.py
index 99f3398..bdf59a2 100644
--- a/admin.py
+++ b/admin.py
@@ -1,10 +1,17 @@
from django.contrib import admin
-from edt.models import Group, Room, Course
+from edt.models import Timetable, Group, Room, Course
+
+
+@admin.register(Timetable)
+class TimetableAdmin(admin.ModelAdmin):
+ prepopulated_fields = {"slug": ("name",)}
+ list_display = ("name", "url",)
@admin.register(Group)
class GroupAdmin(admin.ModelAdmin):
- pass
+ list_display = ("name", "timetable",)
+ list_filter = ("timetable__name",)
@admin.register(Room)
@@ -15,7 +22,8 @@ class RoomAdmin(admin.ModelAdmin):
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
fieldsets = (
- (None, {"fields": ("name", "type", "groups", "rooms",)}),
+ (None, {"fields": ("name", "type", "timetable", "groups", "rooms",)}),
("Horaires", {"fields": ("begin", "end",)}),)
- list_display = ("name", "type", "begin", "end",)
- list_filter = ("type", "groups",)
+ list_display = ("name", "type", "timetable", "begin", "end",)
+ list_filter = ("type", "timetable__name", "groups",)
+ ordering = ("begin",)