forked from DGNum/gestioCOF
Merge remote-tracking branch 'origin/master' into Aufinal/view_spectacles
This commit is contained in:
commit
20f3030552
8 changed files with 27 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -241,7 +241,9 @@ def do_tirage(request, tirage_id):
|
|||
# FIXME: Établir les conditions de validations (formulaire ?)
|
||||
# cf. issue #32
|
||||
if False:
|
||||
Attribution.objects.all().delete()
|
||||
Attribution.objects.filter(
|
||||
spectacle__tirage=tirage_elt
|
||||
).delete()
|
||||
for (show, members, _) in results:
|
||||
for (member, _, _, _) in members:
|
||||
attrib = Attribution(spectacle=show, participant=member)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue