aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'models.py')
-rw-r--r--models.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/models.py b/models.py
index b1a6a1e..b59f2d8 100644
--- a/models.py
+++ b/models.py
@@ -200,6 +200,18 @@ class Room(SlugModel):
verbose_name_plural = "salles"
+class Module(SlugModel):
+ name = models.CharField(max_length=255, unique=True, verbose_name="nom")
+ slug = models.SlugField(max_length=64, default="", unique=True)
+
+ def __str__(self):
+ return self.name
+
+ class Meta:
+ verbose_name = "module"
+ verbose_name_plural = "modules"
+
+
class CourseManager(Manager):
def get_courses(self, obj, **criteria):
qs = self.get_queryset()
@@ -247,6 +259,7 @@ class Course(models.Model):
default=timezone.now)
celcat_id = models.IntegerField(verbose_name="ID Celcat", null=True)
+ module = models.ForeignKey(Module, on_delete=models.SET_NULL, null=True)
def __str__(self):
return self.name