diff --git a/src/shop/admin.py b/src/shop/admin.py index f264f62a..a6f6beb6 100644 --- a/src/shop/admin.py +++ b/src/shop/admin.py @@ -34,6 +34,15 @@ class ProductCategoryAdmin(admin.ModelAdmin): ] +def available_from(product): + return product.available_in.lower.strftime("%c") +available_from.short_description = 'Available from' + +def available_to(product): + return product.available_in.upper.strftime("%c") +available_to.short_description = 'Available to' + + @admin.register(models.Product) class ProductAdmin(admin.ModelAdmin): list_display = [ @@ -41,9 +50,13 @@ class ProductAdmin(admin.ModelAdmin): 'category', 'ticket_type', 'price', - 'available_in', + 'description', + available_from, + available_to ] + search_fields = ['name'] + class ProductInline(admin.TabularInline): model = models.OrderProductRelation