aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-10-19 19:04:23 +0200
committerAlban Gruin2017-10-22 13:16:02 +0200
commit044e7412856aeefa3c82b39130aa8df6582a0826 (patch)
tree9bb3f16bfaec6ea33228189499a857081b1ba30a /models.py
parentff0e5d6388e921ddab2c05cafb27dd662595dee0 (diff)
Suppressions des champs td, tp et parents
Diffstat (limited to 'models.py')
-rw-r--r--models.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/models.py b/models.py
index fbbf877..bfc026b 100644
--- a/models.py
+++ b/models.py
@@ -92,11 +92,6 @@ class Group(models.Model):
mention = models.CharField(max_length=128)
subgroup = models.CharField(max_length=1, verbose_name="sous-groupe",
null=True)
- td = models.IntegerField(verbose_name="groupe de TD", null=True)
- tp = models.IntegerField(verbose_name="groupe de TP", null=True)
- parent = models.ForeignKey("self", verbose_name="groupe parent", null=True,
- default=None, related_name="children")
-
slug = models.SlugField(max_length=64, default="")
hidden = models.BooleanField(verbose_name="caché", default=False)
@@ -110,7 +105,7 @@ class Group(models.Model):
@property
def group_info(self):
- return self.timetable.id, self.mention, self.subgroup, self.td, self.tp
+ return self.timetable.id, self.mention, self.subgroup
def __str__(self):
return self.name
@@ -120,12 +115,12 @@ class Group(models.Model):
self.name = self.celcat_name
self.slug = slugify(self.name)
- self.mention, self.subgroup, self.td, self.tp = parse_group(self.name)
+ self.mention, self.subgroup = parse_group(self.name)
super(Group, self).save()
class Meta:
- index_together = ("mention", "subgroup", "td", "tp",)
+ index_together = ("mention", "subgroup",)
unique_together = (("name", "timetable",),
("celcat_name", "timetable",),
("slug", "timetable",),)