diff options
-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" |