aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-06 12:48:09 +0200
committerAlban Gruin2017-09-06 12:48:09 +0200
commitfe99bdc1bbaa615fbef0c4ced8e3f25a0a110b11 (patch)
tree748f6b532e0102f2f56bd68bc0bfb9bda4bad10b /models.py
parentfb9aee0fcc690b96ccfb8a5d7d587e6a771a563c (diff)
Ajout du modèle « CourseDelta » pour marquer les différences entre
deux mises à jour.
Diffstat (limited to 'models.py')
-rw-r--r--models.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/models.py b/models.py
index de14b43..d78e12b 100644
--- a/models.py
+++ b/models.py
@@ -176,3 +176,22 @@ class Course(models.Model):
class Meta:
verbose_name = "cours"
verbose_name_plural = "cours"
+
+
+class CourseDelta(models.Model):
+ ADDED = 0
+ DELETED = 1
+ OPERATION_CHOICE = (
+ (ADDED, "Ajouté"),
+ (DELETED, "Supprimé"),
+ )
+
+ course = models.ForeignKey(Course, verbose_name="cours")
+ update = models.ForeignKey(LastUpdate, verbose_name="mise à jour")
+ operation = models.IntegerField(choices=OPERATION_CHOICE, default=ADDED, verbose_name="type de modification")
+
+
+ class Meta:
+ unique_together = ("course", "update",)
+ verbose_name = "modification de cours"
+ verbose_name_plural = "modifications de cours"