diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |