diff --git a/settings/templates/settings/settings.html b/settings/templates/settings/settings.html index 267058d..e32510e 100644 --- a/settings/templates/settings/settings.html +++ b/settings/templates/settings/settings.html @@ -43,12 +43,16 @@ Nom Nombre de membres + Nombre de contenus + Nombre de catégories Numéro de téléphone {% for school in schools %} {{school.group.name}} {{school.group.user_set.count}} + {{school.content_set.count}} + {{school.number_of_categories}} {{school.phone}} diff --git a/users/models.py b/users/models.py index 45b251b..577dfb0 100644 --- a/users/models.py +++ b/users/models.py @@ -36,7 +36,10 @@ class SchoolProfile(models.Model): return self.group.name def get_absolute_url(self): - return reverse("users:school", kwargs={'pk':self.pk}) + return reverse("users:school", kwargs={'pk':self.group.pk}) + + def number_of_categories(self): + return self.content_set.values('category').distinct().count() def save(self, *args, **kwargs): viewing_right, _ = Permission.objects.get_or_create(