using context_object_name and moving template

This commit is contained in:
Qwann 2017-02-11 02:51:43 +01:00
parent 45eb384cfd
commit ed01508481
2 changed files with 10 additions and 9 deletions

View file

@ -34,11 +34,12 @@ class DemandeListView(ListView):
class DemandeDetailView(DetailView):
model = PetitCoursDemande
template_name = "details_demande_petit_cours.html"
template_name = "gestioncof/details_demande_petit_cours.html"
context_object_name = "demande"
def get_context_data(self, **kwargs):
context = super(DemandeDetailView, self).get_context_data(**kwargs)
obj = context['object']
obj = self.object
context['attributions'] = obj.petitcoursattribution_set.all()
return context