generated from westfarn/web_django_template
Add customer accounts, shipment tracking, and purchase reviews.
CI / test (pull_request) Successful in 35s
CI / test (pull_request) Successful in 35s
Shoppers can register, save shipping details, and view order history while cards stay on Stripe. EasyPost tracker updates (including numbers from Pirate Ship) and 1–5 star reviews are limited to buyers. The contact form now only asks for email and a message.
This commit is contained in:
+16
-1
@@ -1,6 +1,13 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from shop.models import Order, OrderItem, Product, ProductColor, ProductImage
|
||||
from shop.models import (
|
||||
Order,
|
||||
OrderItem,
|
||||
Product,
|
||||
ProductColor,
|
||||
ProductImage,
|
||||
ProductReview,
|
||||
)
|
||||
|
||||
|
||||
class ProductColorInline(admin.TabularInline):
|
||||
@@ -22,6 +29,13 @@ class ProductAdmin(admin.ModelAdmin):
|
||||
inlines = [ProductColorInline, ProductImageInline]
|
||||
|
||||
|
||||
@admin.register(ProductReview)
|
||||
class ProductReviewAdmin(admin.ModelAdmin):
|
||||
list_display = ("product", "user", "rating", "created_at")
|
||||
list_filter = ("rating",)
|
||||
search_fields = ("product__name", "user__email", "title")
|
||||
|
||||
|
||||
class OrderItemInline(admin.TabularInline):
|
||||
model = OrderItem
|
||||
extra = 0
|
||||
@@ -34,4 +48,5 @@ class OrderAdmin(admin.ModelAdmin):
|
||||
list_display = ("number", "email", "amount", "status", "created_at")
|
||||
list_filter = ("status",)
|
||||
search_fields = ("number", "email", "customer_name")
|
||||
raw_id_fields = ("user",)
|
||||
inlines = [OrderItemInline]
|
||||
|
||||
Reference in New Issue
Block a user