fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blackout
[wolnelektury.git]
/
src
/
funding
/
admin.py
diff --git
a/src/funding/admin.py
b/src/funding/admin.py
index
3e981d8
..
bb44cd4
100644
(file)
--- a/
src/funding/admin.py
+++ b/
src/funding/admin.py
@@
-1,7
+1,6
@@
-# This file is part of Wolne
l
ektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja
Nowoczesna Polska
. See NOTICE for more information.
+# This file is part of Wolne
L
ektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja
Wolne Lektury
. See NOTICE for more information.
#
#
-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 django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from fnpdjango.actions import export_as_csv_action
@@
-24,30
+23,30
@@
class PerkAdmin(TranslationAdmin):
class PayedFilter(admin.SimpleListFilter):
class PayedFilter(admin.SimpleListFilter):
- title =
_('payment complete')
+ title =
'płatność doszła do skutku'
parameter_name = 'payed'
def lookups(self, request, model_admin):
return (
parameter_name = 'payed'
def lookups(self, request, model_admin):
return (
- ('yes',
_('Yes')
),
- ('no',
_('No')
),
+ ('yes',
'Tak'
),
+ ('no',
'Nie'
),
)
def queryset(self, request, queryset):
if self.value() == 'yes':
)
def queryset(self, request, queryset):
if self.value() == 'yes':
- return queryset.exclude(
pay
ed_at=None)
+ return queryset.exclude(
complet
ed_at=None)
elif self.value() == 'no':
elif self.value() == 'no':
- return queryset.filter(
pay
ed_at=None)
+ return queryset.filter(
complet
ed_at=None)
class PerksFilter(admin.SimpleListFilter):
class PerksFilter(admin.SimpleListFilter):
- title =
_('perks')
+ title =
'prezenty'
parameter_name = 'perks'
def lookups(self, request, model_admin):
return (
parameter_name = 'perks'
def lookups(self, request, model_admin):
return (
- ('yes',
_('Yes')
),
- ('no',
_('No')
),
+ ('yes',
'Tak'
),
+ ('no',
'Nie'
),
)
def queryset(self, request, queryset):
)
def queryset(self, request, queryset):
@@
-59,10
+58,15
@@
class PerksFilter(admin.SimpleListFilter):
class FundingAdmin(admin.ModelAdmin):
model = Funding
class FundingAdmin(admin.ModelAdmin):
model = Funding
- list_display = ['
pay
ed_at', 'offer', 'amount', 'name', 'email', 'perk_names']
+ list_display = ['
created_at', 'complet
ed_at', 'offer', 'amount', 'name', 'email', 'perk_names']
search_fields = ['name', 'email', 'offer__title', 'offer__author']
list_filter = [PayedFilter, 'offer', PerksFilter]
search_fields = ['name', 'email', 'offer__title', 'offer__author']
list_filter = [PayedFilter, 'offer', PerksFilter]
- actions = [export_as_csv_action()]
+ actions = [export_as_csv_action(
+ fields=[
+ 'id', 'offer', 'name', 'email', 'amount', 'completed_at',
+ 'notifications', 'notify_key', 'wl_optout_url'
+ ]
+ )]
class SpentAdmin(admin.ModelAdmin):
class SpentAdmin(admin.ModelAdmin):