Skip to content

Commit

Permalink
fix: make Purchase admin lighter
Browse files Browse the repository at this point in the history
  • Loading branch information
AmooHashem committed Dec 19, 2024
1 parent 7938756 commit 4c060ce
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/sale/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ class MerchandiseCustomAdmin(admin.ModelAdmin):
list_display = ['id', 'name', 'program',
'price', 'discounted_price', 'is_active', 'is_deleted']
list_filter = ['is_active', 'program']
search_fields = ['name']


@admin.register(Purchase)
class CustomPurchaseAdmin(admin.ModelAdmin):
model = Purchase
list_display = ['id', 'ref_id', 'amount',
'status', 'created_at', 'user', 'merchandise']
search_fields = ['user__username']
autocomplete_fields = ['user', 'merchandise', 'voucher', 'discount_code']


admin.site.register(Voucher)
admin.site.register(DiscountCode)
@admin.register(Voucher)
class CustomVoucherAdmin(admin.ModelAdmin):
search_fields = ['code']


@admin.register(DiscountCode)
class CustomDiscountCodeAdmin(admin.ModelAdmin):
search_fields = ['code']

0 comments on commit 4c060ce

Please sign in to comment.