Initial commit
This commit is contained in:
commit
19170142c3
20 changed files with 894 additions and 0 deletions
18
froide_govplan/views.py
Normal file
18
froide_govplan/views.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue