Add plan follower model and configuration

This commit is contained in:
Stefan Wehrmeyer 2022-03-11 23:40:37 +01:00
parent 829315c1dc
commit 7792674ed7
4 changed files with 150 additions and 0 deletions

View file

@ -10,6 +10,7 @@ from taggit.managers import TaggableManager
from taggit.models import TaggedItemBase
from froide.foirequest.models import FoiRequest
from froide.follow.models import Follower
from froide.organization.models import Organization
from froide.publicbody.models import Category, Jurisdiction, PublicBody
@ -237,6 +238,19 @@ class GovernmentPlanUpdate(models.Model):
return "{} - {} ({})".format(self.title, self.timestamp, self.plan)
class GovernmentPlanFollower(Follower):
content_object = models.ForeignKey(
GovernmentPlan,
on_delete=models.CASCADE,
related_name="followers",
verbose_name=_("Government plan"),
)
class Meta(Follower.Meta):
verbose_name = _("Government plan follower")
verbose_name_plural = _("Government plan followers")
if CMSPlugin:
PLUGIN_TEMPLATES = [