Ajoute une fonction de remise à zéro des compteurs de petits cours

This commit is contained in:
ludo 2016-06-17 18:31:10 +02:00
parent f00e081b0b
commit 8edd6dafcd

View file

@ -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')