From 25166bcee501d1e5d72a2d2372cbeb5c3b82eec7 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Wed, 6 Sep 2017 16:32:24 +0200 Subject: Ajout d’un champ pour stocker l’ID d’un cours dans Celcat --- admin.py | 3 ++- models.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/admin.py b/admin.py index 9155924..0649845 100644 --- a/admin.py +++ b/admin.py @@ -54,12 +54,13 @@ class RoomAdmin(admin.ModelAdmin): @admin.register(Course) class CourseAdmin(admin.ModelAdmin): fieldsets = ( - (None, {"fields": ("name", "type", "timetable", "groups", "rooms", "active",)}), + (None, {"fields": ("name", "type", "timetable", "groups", "rooms", "active", "celcat_id",)}), ("Horaires", {"fields": ("begin", "end",)}), ("Remarques", {"fields": ("notes",)}),) list_display = ("name", "type", "timetable", "begin", "end", "active",) list_filter = ("type", "timetable__name", "groups", "active",) ordering = ("begin",) + readonly_fields = ("celcat_id",) @admin.register(CourseDelta) diff --git a/models.py b/models.py index 5646a07..6296ce1 100644 --- a/models.py +++ b/models.py @@ -160,6 +160,8 @@ class Course(models.Model): active = models.BooleanField(verbose_name="actif", default=True) checked = models.BooleanField(default=True, db_index=True) + celcat_id = models.IntegerField(verbose_name="ID dans Celcat") + def __str__(self): return self.name -- cgit v1.2.1