From 77748ec01d1ef59d8436597a9b52675b309e1c4d Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 24 Sep 2017 15:50:58 +0200 Subject: Ajout du champ last_update dans le modèle des cours --- admin.py | 2 +- models.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/admin.py b/admin.py index 16e34f3..4a238be 100644 --- a/admin.py +++ b/admin.py @@ -57,7 +57,7 @@ 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", "last_update",)}), ("Horaires", {"fields": ("begin", "end",)}), ("Remarques", {"fields": ("notes",)}),) list_display = ("name", "type", "timetable", "begin", "end",) diff --git a/models.py b/models.py index f223317..4a25b01 100644 --- a/models.py +++ b/models.py @@ -161,6 +161,8 @@ class Course(models.Model): begin = models.DateTimeField(verbose_name="début du cours", db_index=True) end = models.DateTimeField(verbose_name="fin du cours") + last_update = models.DateTimeField(verbose_name="dernière mise à jour") + def __str__(self): return self.name -- cgit v1.2.1