Adding the core applications code to the repository

This commit is contained in:
artus
2016-08-05 10:41:43 +02:00
parent 243ff9153e
commit 5f4faf46ec
155 changed files with 13176 additions and 0 deletions

32
suivi/views.py Normal file
View File

@@ -0,0 +1,32 @@
from django.shortcuts import render
from django.views import generic
from website import views
from sujets.models import Sujet
# Create your views here.
class SuivisView(views.WebsiteProtectedMixin):
title = "Suivi des bénéficiaires"
header = "Suivi"
permissions = ['sujets.view_sujets']
class IndexView(SuivisView, generic.TemplateView):
template_name = "suivis/index.html"
header_small = "Tableau de bord"
class SuiviSujetView(SuivisView, generic.DetailView):
model = Sujet
template_name = "suivis/details.html"
context_object_name = "sujet"
def get_context_date(self, **kwargs):
context = super().get_context_data(**kwargs)
context['notes'] = self.object.notes.all()
return context