aboutsummaryrefslogblamecommitdiffstats
path: root/alphabetlearning/payments/admin.py
blob: fc0db9160a18ac403dedfc7cd5511571160baa89 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                
                            
                               
                                     
                         

                                
 

                                     
 
                                       
                                 
 
 


                                                
 
                                              




                                                                        


                                          



                                                           

 

                                                                


                                          
                                                                  

 
                                            
                          
                                      
                                                    
                             
                                                    
                                                         
from django.contrib import admin

from .models import CartItem
from .models import EmailSignup
from .models import EmailVerification
from .models import Price
from .models import ShoppingCart
from .models import Subscription

# class PriceAdmin(admin.ModelAdmin):
#    list_display =

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


class SuccessEmailSignupAdmin(admin.ModelAdmin):
    list_display = ("email", "date_added")


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


class CartItemAdminInline(admin.TabularInline):
    model = CartItem


class ShoppingCartAdmin(admin.ModelAdmin):
    #   list_display = ("user", "created_at", "updated_at")
    inlines = [
        CartItemAdminInline,
    ]


# 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(Price)
admin.site.register(EmailVerification)
admin.site.register(ShoppingCart, ShoppingCartAdmin)
admin.site.register(CartItem)
admin.site.register(Subscription, SubscriptionAdmin)
admin.site.register(EmailSignup, SuccessEmailSignupAdmin)