diff options
author | Alban Gruin | 2017-01-19 14:47:47 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-19 14:47:47 +0100 |
commit | ffa4f692a6b205de7b677502e1d3f6513bedfa93 (patch) | |
tree | 4f7849c256c3657aae57495cbbbe31982ed71615 /models.py | |
parent | d07ff320d264e5a0eee20eb7afa2f2a0fab18fb4 (diff) |
Ajout d'index sur certains champs
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -19,10 +19,10 @@ class Group(models.Model): name = models.CharField(max_length=255, verbose_name="nom") timetable = models.ForeignKey(Timetable, on_delete=models.CASCADE, verbose_name="emploi du temps") - mention = models.CharField(max_length=32) - subgroup = models.CharField(max_length=1, verbose_name="sous-groupe") - td = models.IntegerField(verbose_name="groupe de TD", null=True) - tp = models.IntegerField(verbose_name="groupe de TP", null=True) + mention = models.CharField(max_length=32, db_index=True) + subgroup = models.CharField(max_length=1, verbose_name="sous-groupe", db_index=True) + td = models.IntegerField(verbose_name="groupe de TD", null=True, db_index=True) + tp = models.IntegerField(verbose_name="groupe de TP", null=True, db_index=True) def __str__(self): return self.name @@ -68,7 +68,7 @@ class Course(models.Model): groups = models.ManyToManyField(Group, verbose_name="groupes") rooms = models.ManyToManyField(Room, verbose_name="salles") - begin = models.DateTimeField(verbose_name="début du cours") + begin = models.DateTimeField(verbose_name="début du cours", db_index=True) end = models.DateTimeField(verbose_name="fin du cours") def __str__(self): |