Initial commit

This commit is contained in:
Stefan Wehrmeyer 2022-02-15 21:09:09 +01:00
commit 19170142c3
20 changed files with 894 additions and 0 deletions

18
froide_govplan/views.py Normal file
View file

@ -0,0 +1,18 @@
from django.views.generic import DetailView
from .models import GovernmentPlan
class GovPlanDetailView(DetailView):
slug_url_kwarg = "plan"
template_name = "froide_govplan/detail.html"
def get_queryset(self):
return GovernmentPlan.objects.filter(public=True)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["updates"] = self.object.updates.filter(public=True).order_by(
"-timestamp"
)
return context