X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..6abcfa9732ddf2221e4edb0f276067c4283e8796:/src/funding/admin.py?ds=inline diff --git a/src/funding/admin.py b/src/funding/admin.py index a59704dbd..27109e696 100644 --- a/src/funding/admin.py +++ b/src/funding/admin.py @@ -3,17 +3,20 @@ # from django.utils.translation import ugettext_lazy as _ from django.contrib import admin +from modeltranslation.admin import TranslationAdmin +from fnpdjango.actions import export_as_csv_action from .models import Offer, Perk, Funding, Spent -class OfferAdmin(admin.ModelAdmin): +class OfferAdmin(TranslationAdmin): model = Offer list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end'] search_fields = ['title', 'author'] readonly_fields = ('cover_img_tag',) + autocomplete_fields = ['book'] -class PerkAdmin(admin.ModelAdmin): +class PerkAdmin(TranslationAdmin): model = Perk search_fields = ['name', 'long_name'] list_display = ['name', 'long_name', 'price', 'end_date', 'offer'] @@ -59,6 +62,12 @@ class FundingAdmin(admin.ModelAdmin): list_display = ['payed_at', 'offer', 'amount', 'name', 'email', 'perk_names'] search_fields = ['name', 'email', 'offer__title', 'offer__author'] list_filter = [PayedFilter, 'offer', PerksFilter] + actions = [export_as_csv_action( + fields=[ + 'id', 'offer', 'name', 'email', 'amount', 'payed_at', + 'notifications', 'notify_key', 'wl_optout_url' + ] + )] class SpentAdmin(admin.ModelAdmin):