1 from django.contrib import admin
2 from modeltranslation.admin import TranslationAdmin
6 class PlanAdmin(admin.ModelAdmin):
7 list_display = ['min_amount', 'interval']
9 admin.site.register(models.Plan, PlanAdmin)
12 class PaymentInline(admin.TabularInline):
13 model = models.Payment
15 readonly_fields = ['payed_at']
18 class ScheduleAdmin(admin.ModelAdmin):
19 list_display = ['email', 'started_at', 'expires_at', 'plan', 'amount', 'is_active', 'is_cancelled']
20 list_search = ['email']
21 list_filter = ['is_active', 'is_cancelled']
22 date_hierarchy = 'started_at'
23 inlines = [PaymentInline]
25 admin.site.register(models.Schedule, ScheduleAdmin)
28 class PaymentAdmin(admin.ModelAdmin):
29 list_display = ['payed_at', 'schedule']
31 admin.site.register(models.Payment, PaymentAdmin)
34 class MembershipAdmin(admin.ModelAdmin):
37 admin.site.register(models.Membership, MembershipAdmin)
40 admin.site.register(models.ReminderEmail, TranslationAdmin)