Incorpore le tirage dans admin/participant.

- Affiche le tirage de chaque participant.
- Permet de filtrer par tirage
This commit is contained in:
Martin Pépin 2016-06-19 18:34:44 +02:00
parent fd7673b056
commit 25fc2579f0

View file

@ -16,7 +16,6 @@ class AttributionInline(admin.TabularInline):
model = Attribution
class ParticipantAdmin(admin.ModelAdmin):
#inlines = [ChoixSpectacleInline]
inlines = [AttributionInline]
def get_queryset(self, request):
return Participant.objects.annotate(nb_places = Count('attributions'),
@ -31,8 +30,9 @@ class ParticipantAdmin(admin.ModelAdmin):
else: return u"0 €"
total.admin_order_field = "total"
total.short_description = "Total à payer"
list_display = ("user", "nb_places", "total", "paid", "paymenttype")
list_filter = ("paid",)
list_display = ("user", "nb_places", "total", "paid", "paymenttype",
"tirage")
list_filter = ("paid", "tirage")
search_fields = ('user__username', 'user__first_name', 'user__last_name')
actions = ['send_attribs',]
actions_on_bottom = True