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 PayUOrderInline(admin.TabularInline):
13 model = models.PayUOrder
15 show_change_link = True
18 class PayUCardTokenInline(admin.TabularInline):
19 model = models.PayUCardToken
21 show_change_link = True
24 class ScheduleAdmin(admin.ModelAdmin):
25 list_display = ['email', 'started_at', 'expires_at', 'plan', 'amount', 'is_cancelled']
26 list_search = ['email']
27 list_filter = ['is_cancelled']
28 date_hierarchy = 'started_at'
29 raw_id_fields = ['membership']
30 inlines = [PayUOrderInline, PayUCardTokenInline]
32 admin.site.register(models.Schedule, ScheduleAdmin)
35 class ScheduleInline(admin.TabularInline):
36 model = models.Schedule
38 show_change_link = True
40 class MembershipAdmin(admin.ModelAdmin):
41 list_display = ['user']
42 raw_id_fields = ['user']
43 search_fields = ['user__username', 'user__email']
44 inlines = [ScheduleInline]
46 admin.site.register(models.Membership, MembershipAdmin)
49 admin.site.register(models.ReminderEmail, TranslationAdmin)
52 admin.site.register(models.PayUNotification)