X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d7b11e4a01b2314c0527d94d91f3159c0bd34ce..ef759fbfa694cdddd1b24027a6f8792302add9b8:/apps/funding/admin.py?ds=sidebyside diff --git a/apps/funding/admin.py b/apps/funding/admin.py old mode 100755 new mode 100644 index 7fbb4c488..c8a25d013 --- a/apps/funding/admin.py +++ b/apps/funding/admin.py @@ -1,7 +1,36 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib import admin from .models import Offer, Perk, Funding, Spent -admin.site.register(Spent) -admin.site.register(Offer) -admin.site.register(Perk) -admin.site.register(Funding) + +class OfferAdmin(admin.ModelAdmin): + model = Offer + list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end'] + search_fields = ['title', 'author'] + readonly_fields = ('cover_img_tag',) + + +class PerkAdmin(admin.ModelAdmin): + model = Perk + list_display = ['name', 'long_name', 'price', 'end_date', 'offer'] + + +class FundingAdmin(admin.ModelAdmin): + model = Funding + list_display = ['payed_at', 'offer', 'amount', 'name', 'email'] + search_fields = ['name', 'email', 'offer__title', 'offer__author'] + + +class SpentAdmin(admin.ModelAdmin): + model = Spent + list_display = ['book', 'amount', 'timestamp'] + search_fields = ['book__title'] + + +admin.site.register(Offer, OfferAdmin) +admin.site.register(Perk, PerkAdmin) +admin.site.register(Funding, FundingAdmin) +admin.site.register(Spent, SpentAdmin)