Add sections progress plugin

This commit is contained in:
Stefan Wehrmeyer 2022-03-14 14:29:02 +01:00
parent bde9bf6000
commit f83a193916
4 changed files with 18 additions and 9 deletions

View file

@ -354,6 +354,15 @@ class GovernmentPlanSection(models.Model):
def get_absolute_domain_url(self):
return settings.SITE_URL + self.get_absolute_url()
def get_plans(self):
return (
GovernmentPlan.objects.filter(
categories__in=self.categories.all(), government=self.government
)
.distinct()
.order_by("title")
)
if CMSPlugin: