Fewer requests on petit cours list management.

This commit is contained in:
Aurélien Delobelle 2017-04-09 17:51:40 +02:00
parent 8870b5ace2
commit 3dc91e30bd

View file

@ -24,13 +24,14 @@ from gestioncof.shared import lock_table, unlock_tables
class DemandeListView(ListView):
model = PetitCoursDemande
queryset = (
PetitCoursDemande.objects
.prefetch_related('matieres')
.order_by('traitee', '-id')
)
template_name = "petits_cours_demandes_list.html"
paginate_by = 20
def get_queryset(self):
return PetitCoursDemande.objects.order_by('traitee', '-id').all()
class DemandeDetailView(DetailView):
model = PetitCoursDemande