Merge branch 'Kerl/update_participant_admin' into 'master'

Incorpore le tirage dans `admin/participant`.

Dans la liste des participants, dans l'interface admin : 

- Affiche le tirage de chaque participant.
- Permet de filtrer par tirage

See merge request !45
This commit is contained in:
Basile Clement 2016-06-21 22:53:05 +02:00
commit fa4f1328b5

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