fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Django 2.2
[wolnelektury.git]
/
src
/
club
/
admin.py
diff --git
a/src/club/admin.py
b/src/club/admin.py
index
76cc71e
..
64218f1
100644
(file)
--- a/
src/club/admin.py
+++ b/
src/club/admin.py
@@
-1,3
+1,6
@@
+# 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 modeltranslation.admin import TranslationAdmin
from . import models
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from . import models
@@
-9,35
+12,44
@@
class PlanAdmin(admin.ModelAdmin):
admin.site.register(models.Plan, PlanAdmin)
admin.site.register(models.Plan, PlanAdmin)
-class Pay
ment
Inline(admin.TabularInline):
- model = models.Pay
ment
+class Pay
UOrder
Inline(admin.TabularInline):
+ model = models.Pay
UOrder
extra = 0
extra = 0
- readonly_fields = ['payed_at']
+ show_change_link = True
+
+
+class PayUCardTokenInline(admin.TabularInline):
+ model = models.PayUCardToken
+ extra = 0
+ show_change_link = True
class ScheduleAdmin(admin.ModelAdmin):
class ScheduleAdmin(admin.ModelAdmin):
- list_display = ['email', 'started_at', 'expires_at', 'plan', 'amount', 'is_
active', 'is_
cancelled']
+ list_display = ['email', 'started_at', 'expires_at', 'plan', 'amount', 'is_cancelled']
list_search = ['email']
list_search = ['email']
- list_filter = ['is_
active', 'is_
cancelled']
+ list_filter = ['is_cancelled']
date_hierarchy = 'started_at'
raw_id_fields = ['membership']
date_hierarchy = 'started_at'
raw_id_fields = ['membership']
- inlines = [Pay
ment
Inline]
+ inlines = [Pay
UOrderInline, PayUCardToken
Inline]
admin.site.register(models.Schedule, ScheduleAdmin)
admin.site.register(models.Schedule, ScheduleAdmin)
-class PaymentAdmin(admin.ModelAdmin):
- list_display = ['payed_at', 'schedule']
-
-admin.site.register(models.Payment, PaymentAdmin)
-
+class ScheduleInline(admin.TabularInline):
+ model = models.Schedule
+ extra = 0
+ show_change_link = True
class MembershipAdmin(admin.ModelAdmin):
list_display = ['user']
raw_id_fields = ['user']
search_fields = ['user__username', 'user__email']
class MembershipAdmin(admin.ModelAdmin):
list_display = ['user']
raw_id_fields = ['user']
search_fields = ['user__username', 'user__email']
+ inlines = [ScheduleInline]
admin.site.register(models.Membership, MembershipAdmin)
admin.site.register(models.ReminderEmail, TranslationAdmin)
admin.site.register(models.Membership, MembershipAdmin)
admin.site.register(models.ReminderEmail, TranslationAdmin)
+
+
+admin.site.register(models.PayUNotification)