2023-04-27 21:06:28 +00:00
|
|
|
from django.forms import fields
|
2023-04-24 20:11:27 +00:00
|
|
|
|
2023-04-27 21:06:28 +00:00
|
|
|
from wagtail.contrib.modeladmin.options import (
|
|
|
|
ModelAdmin,
|
|
|
|
ModelAdminGroup,
|
|
|
|
modeladmin_register
|
|
|
|
)
|
|
|
|
from wagtail.admin.forms.models import WagtailAdminModelForm
|
|
|
|
|
|
|
|
from store import models
|
|
|
|
|
|
|
|
|
2023-05-10 19:47:03 +00:00
|
|
|
class ProductAuthorAdmin(ModelAdmin):
|
|
|
|
model = models.ProductAuthor
|
|
|
|
list_display = ("name", )
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
|
2023-05-10 19:47:03 +00:00
|
|
|
class ProductCategoryAdmin(ModelAdmin):
|
|
|
|
model = models.ProductCategory
|
|
|
|
list_display = ("name", )
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
|
2023-05-10 19:47:03 +00:00
|
|
|
class ProductCategoryParamAdmin(ModelAdmin):
|
|
|
|
model = models.ProductCategoryParam
|
|
|
|
list_display = ("key", "param_type")
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
|
2023-05-10 19:47:03 +00:00
|
|
|
class ProductTemplateAdmin(ModelAdmin):
|
2023-06-22 21:56:13 +00:00
|
|
|
menu_label = "Product design"
|
2023-05-10 19:47:03 +00:00
|
|
|
model = models.ProductTemplate
|
|
|
|
list_display = ("title", "code")
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProductAdmin(ModelAdmin):
|
2023-06-22 21:56:13 +00:00
|
|
|
menu_label = "Product variant"
|
2023-04-27 21:06:28 +00:00
|
|
|
model = models.Product
|
2023-05-10 19:47:03 +00:00
|
|
|
list_display = ("title", "price")
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
|
2023-06-18 14:18:00 +00:00
|
|
|
class PaymentMethodAdmin(ModelAdmin):
|
|
|
|
model = models.PaymentMethod
|
|
|
|
list_display = ("name", "active")
|
|
|
|
|
2023-06-07 23:39:06 +00:00
|
|
|
|
|
|
|
class DocumentTemplateAdmin(ModelAdmin):
|
|
|
|
model = models.DocumentTemplate
|
2023-06-18 14:18:00 +00:00
|
|
|
list_display = ("name", )
|
2023-06-07 23:39:06 +00:00
|
|
|
|
|
|
|
|
2023-04-27 21:06:28 +00:00
|
|
|
class StoreAdminGroup(ModelAdminGroup):
|
|
|
|
menu_label = "Store"
|
|
|
|
menu_icon = 'folder-open-inverse'
|
|
|
|
menu_order = 200
|
2023-05-10 19:47:03 +00:00
|
|
|
items = (
|
|
|
|
ProductAuthorAdmin,
|
|
|
|
ProductCategoryAdmin,
|
|
|
|
ProductCategoryParamAdmin,
|
|
|
|
ProductTemplateAdmin,
|
2023-06-07 23:39:06 +00:00
|
|
|
ProductAdmin,
|
2023-06-18 14:18:00 +00:00
|
|
|
DocumentTemplateAdmin,
|
|
|
|
PaymentMethodAdmin
|
2023-05-10 19:47:03 +00:00
|
|
|
)
|
|
|
|
|
2023-04-27 21:06:28 +00:00
|
|
|
|
|
|
|
modeladmin_register(StoreAdminGroup)
|