aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"