bornhack-website/shop/admin.py

49 lines
895 B
Python
Raw Normal View History

from django.contrib import admin
2016-05-16 19:45:43 +00:00
from .models import Order, ProductCategory, Product, OrderProductRelation, EpayCallback, EpayPayment
2016-05-16 19:45:43 +00:00
admin.site.register(EpayCallback)
admin.site.register(EpayPayment)
@admin.register(ProductCategory)
class ProductCategoryAdmin(admin.ModelAdmin):
list_display = [
'name',
]
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
list_display = [
'name',
'category',
'price',
'available_in',
]
class ProductInline(admin.TabularInline):
model = OrderProductRelation
@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
list_display = [
'user',
'camp',
'payment_method',
'paid',
]
list_filter = [
'user',
'camp',
'payment_method',
'paid',
]
exclude = ['products']
inlines = [ProductInline]