diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -71,13 +71,13 @@ class GroupManager(Manager): parent_in = self.get_queryset().filter(parent=group) return self.get_queryset().filter(Q(parent=group) | Q(parent__in=parent_in)) \ .annotate(children_count=Count("children")) \ - .filter(children_count=0) \ + .filter(children_count=0, hidden=False) \ .order_by("name") def get_relevant_groups(self, *args, **criteria): return self.get_queryset().filter(*args, **criteria) \ .annotate(children_count=Count("children")) \ - .filter(children_count=0) + .filter(children_count=0, hidden=False) class Group(models.Model): @@ -99,6 +99,8 @@ class Group(models.Model): slug = models.SlugField(max_length=64, default="") + hidden = models.BooleanField(verbose_name="caché", default=False) + def corresponds_to(self, timetable_id, mention, subgroup, td, tp): return self.timetable.id == timetable_id and \ self.mention.startswith(mention) and \ |