Added voucher validity boolean icon display.
This commit is contained in:
parent
6a1229a4ba
commit
222c97d63c
@ -17,6 +17,11 @@ class VoucherAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ['created_when']
|
||||
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):
|
||||
list_display = ('label', 'place', 'url' )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user