Files
@ 7fac10241ec7
Branch filter:
Location: symposion_app/pinaxcon/raffle/admin.py - annotation
7fac10241ec7
1.3 KiB
text/x-python
Improve attendee reports
Display attendee profile data in normal table without DataTables so
sorting is not applied, causing data to be confusing to read.
Include item quantity in attendee data report for accurate schwag packing.
Display attendee profile data in normal table without DataTables so
sorting is not applied, causing data to be confusing to read.
Include item quantity in attendee data report for accurate schwag packing.
d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c d1ff8d72533c | from django.contrib import admin
from pinaxcon.raffle import models
class ReadOnlyMixin:
actions = None
list_display_links = None
def has_add_permission(self, request):
return False
def has_delete_permission(self, request, obj=None):
return False
def save_model(self, request, obj, form, change):
return
class DrawAdmin(ReadOnlyMixin, admin.ModelAdmin):
list_display = ('raffle', 'drawn_time', 'drawn_by')
readonly_fields = ('raffle', 'drawn_time', 'drawn_by')
list_filter = ('raffle',)
ordering = ('raffle', '-drawn_time')
class DrawnTicketAdmin(ReadOnlyMixin, admin.ModelAdmin):
list_display = ('draw', 'ticket')
readonly_fields = ('draw', 'ticket', 'lineitem', 'prize')
class AuditAdmin(ReadOnlyMixin, admin.ModelAdmin):
list_display = ('timestamp', 'raffle', 'prize', 'reason', 'user',)
list_filter = ('prize__raffle',)
readonly_fields = ('reason', 'prize', 'user')
def raffle(self, instance):
return instance.prize.raffle
class PrizeAdmin(admin.ModelAdmin):
readonly_fields = ('winning_ticket',)
admin.site.register(models.Raffle)
admin.site.register(models.Prize, PrizeAdmin)
admin.site.register(models.Draw, DrawAdmin)
admin.site.register(models.DrawnTicket, DrawnTicketAdmin)
admin.site.register(models.PrizeAudit, AuditAdmin)
|