fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ca8f4e8
)
add a filter
master
author
Radek Czajka
<rczajka@rczajka.pl>
Tue, 26 Nov 2024 13:43:39 +0000
(14:43 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Tue, 26 Nov 2024 13:43:39 +0000
(14:43 +0100)
src/club/admin.py
patch
|
blob
|
history
diff --git
a/src/club/admin.py
b/src/club/admin.py
index
8e4380e
..
fc715e2
100644
(file)
--- a/
src/club/admin.py
+++ b/
src/club/admin.py
@@
-67,6
+67,12
@@
class ExpiredFilter(YesNoFilter):
q = Q(expires_at__isnull=False, expires_at__lt=Now())
q = Q(expires_at__isnull=False, expires_at__lt=Now())
+class ActiveFilter(YesNoFilter):
+ title = 'płatność aktualna'
+ parameter_name = 'active'
+ q = Q(expires_at__gt=Now())
+
+
class ScheduleForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class ScheduleForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@
-111,7
+117,7
@@
class ScheduleAdmin(admin.ModelAdmin):
search_fields = ['email', 'source']
list_filter = [
'is_cancelled', 'monthly', 'yearly', 'method',
search_fields = ['email', 'source']
list_filter = [
'is_cancelled', 'monthly', 'yearly', 'method',
- PayedFilter, ExpiredFilter,
+ PayedFilter,
ActiveFilter,
ExpiredFilter,
SourceFilter,
]
filter_horizontal = ['consent']
SourceFilter,
]
filter_horizontal = ['consent']