From 8edd6dafcdb57fc94491505a45ad77fbd7eb6e52 Mon Sep 17 00:00:00 2001 From: ludo Date: Fri, 17 Jun 2016 18:31:10 +0200 Subject: [PATCH] =?UTF-8?q?Ajoute=20une=20fonction=20de=20remise=20=C3=A0?= =?UTF-8?q?=20z=C3=A9ro=20des=20compteurs=20de=20petits=20cours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gestioncof/admin.py b/gestioncof/admin.py index 785ab6a2..03cb3b33 100644 --- a/gestioncof/admin.py +++ b/gestioncof/admin.py @@ -154,6 +154,13 @@ class PetitCoursAttributionCounterAdmin(admin.ModelAdmin): list_display = ('user','matiere','count',) list_filter = ('matiere',) search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'matiere__name') + actions = ['reset',] + actions_on_bottom = True + + def reset(self, request, queryset): + queryset.update(count=0) + reset.short_description = u"Remise à zéro du compteur" + class PetitCoursDemandeAdmin(admin.ModelAdmin): list_display = ('name','email','agrege_requis','niveau','created','traitee','processed')