aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/payments/admin.py')
-rw-r--r--pyblackbird_cc/payments/admin.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/pyblackbird_cc/payments/admin.py b/pyblackbird_cc/payments/admin.py
new file mode 100644
index 0000000..526a1f0
--- /dev/null
+++ b/pyblackbird_cc/payments/admin.py
@@ -0,0 +1,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)