aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/payments/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-15 21:01:31 +0100
committerMatthew Lemon <y@yulqen.org>2024-10-15 21:01:31 +0100
commiteeaddb27560d723ca7d61359744ceb2709fccd2d (patch)
tree04ddbc49ae7b73d5f5a9e1716d7227aecd3b9f85 /alphabetlearning/payments/admin.py
parent7a3044c859043837e6c7c95bb4894d04e9b2cbc2 (diff)
Renamed from pyblackbird_cc to alphabetlearning - everywhere
Diffstat (limited to 'alphabetlearning/payments/admin.py')
-rw-r--r--alphabetlearning/payments/admin.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/alphabetlearning/payments/admin.py b/alphabetlearning/payments/admin.py
new file mode 100644
index 0000000..f6a00a2
--- /dev/null
+++ b/alphabetlearning/payments/admin.py
@@ -0,0 +1,38 @@
+from django.contrib import admin
+
+from .models import CartItem
+from .models import Price
+from .models import Product
+from .models import ShoppingCart
+from .models import Subscription
+from .models import SubscriptionPlan
+
+
+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)