verwaltungstracker/froide_govplan/views.py
Stefan Wehrmeyer 19170142c3 Initial commit
2022-02-15 22:18:19 +01:00

18 lines
516 B
Python

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