diff options
author | Alban Gruin | 2019-06-09 18:21:51 +0200 |
---|---|---|
committer | Alban Gruin | 2019-06-09 18:21:51 +0200 |
commit | dab185062a58b73c9770a5d474ff3c5cd5ebcebf (patch) | |
tree | d6671696feeff23f270e8c67765f4e791f7c5e02 /models.py | |
parent | 2386b8d41d88c1408411b378ce5e2a8c09c382e7 (diff) | |
parent | b9f77648d0fb6897fad180627401c6b9c3e75943 (diff) |
Merge branch 'ag/parser' into futur
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 Alban Gruin +# Copyright (C) 2017-2019 Alban Gruin # # celcatsanitizer is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published @@ -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() @@ -246,6 +258,9 @@ class Course(models.Model): last_update = models.DateTimeField(verbose_name="dernière mise à jour", 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 |