1 from django.contrib import admin
2 from .models import Offer, Perk, Funding, Spent
5 class OfferAdmin(admin.ModelAdmin):
7 list_display = ['title', 'author', 'target', 'sum', 'state', 'start', 'end', 'due']
8 search_fields = ['title', 'author']
11 class PerkAdmin(admin.ModelAdmin):
13 list_display = ['name', 'price', 'end_date', 'offer']
16 class FundingAdmin(admin.ModelAdmin):
18 list_display = ['payed_at', 'offer', 'amount', 'name', 'email']
19 search_fields = ['name', 'email', 'offer__title', 'offer__author']
22 class SpentAdmin(admin.ModelAdmin):
24 list_display = ['book', 'amount', 'timestamp']
25 search_fields = ['book__title']
28 admin.site.register(Offer, OfferAdmin)
29 admin.site.register(Perk, PerkAdmin)
30 admin.site.register(Funding, FundingAdmin)
31 admin.site.register(Spent, SpentAdmin)