aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-10-19 19:04:23 +0200
committerAlban Gruin2017-10-19 19:04:23 +0200
commit781ba0419a5e7bba423c922180c2c2db2327543a (patch)
tree299e28b58c0583b001c9b20099a9e8ae00e536e1 /models.py
parente13b5bb8b08c336f61403480df6bbfbe29f2316b (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",),)