Added voucher validity boolean icon display.

This commit is contained in:
Marcus Scholz 2020-09-18 21:19:31 +02:00
parent 6a1229a4ba
commit 222c97d63c

View File

@ -17,6 +17,11 @@ class VoucherAdmin(admin.ModelAdmin):
readonly_fields = ['created_when'] readonly_fields = ['created_when']
list_display = ('__str__', 'code', 'created_when', 'expires_when', 'valid') list_display = ('__str__', 'code', 'created_when', 'expires_when', 'valid')
def valid(self, instance):
return timezone.now() <= instance.expires_when
valid.boolean = True
class PhotoAlbumsAdmin(admin.ModelAdmin): class PhotoAlbumsAdmin(admin.ModelAdmin):
list_display = ('label', 'place', 'url' ) list_display = ('label', 'place', 'url' )