aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/admin.py
blob: 526a1f0e72eabc66723ced70264e4333ccaf6494 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from django.contrib import admin

from .models import ShoppingCart, CartItem, Subscription, SubscriptionPlan, Product, Price


class PriceInlineAdmin(admin.TabularInline):
    model = Price
    extra = 0

class ProductAdmin(admin.ModelAdmin):
    inlines = [PriceInlineAdmin]

class SubscriptionPlanAdmin(admin.ModelAdmin):
    list_display = ('name', 'price', 'description', 'allowed_downloads')


class ShoppingCartAdmin(admin.ModelAdmin):
    list_display = ('user', 'created_at', 'updated_at')


class CartItemAdmin(admin.ModelAdmin):
    list_display = ('cart', 'resource', 'quantity', 'added_at')


class SubscriptionAdmin(admin.ModelAdmin):
    list_display = ('user', 'is_active', 'start_date', 'end_date')


admin.site.register(Product, ProductAdmin)
admin.site.register(SubscriptionPlan)
admin.site.register(ShoppingCart)
admin.site.register(CartItem)
admin.site.register(Subscription)