diff options
author | Alban Gruin | 2017-09-06 12:48:09 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-06 12:48:09 +0200 |
commit | fe99bdc1bbaa615fbef0c4ced8e3f25a0a110b11 (patch) | |
tree | 748f6b532e0102f2f56bd68bc0bfb9bda4bad10b /models.py | |
parent | fb9aee0fcc690b96ccfb8a5d7d587e6a771a563c (diff) |
Ajout du modèle « CourseDelta » pour marquer les différences entre
deux mises à jour.
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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" |