Features:

1) Add PRODUCT_SCHEMA to supported schemas;
2) Implement @extend_schema_view decorator for ProductViewSet;

Fixes:
1) None;

Extra:
1) None;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-05-08 17:25:14 +03:00
parent 9f64b4214b
commit 9941b45bd3

View file

@ -19,6 +19,7 @@ from core.docs.drf.viewsets import (
ATTRIBUTE_VALUE_SCHEMA,
CATEGORY_SCHEMA,
ORDER_SCHEMA,
PRODUCT_SCHEMA,
WISHLIST_SCHEMA,
)
from core.filters import BrandFilter, CategoryFilter, OrderFilter, ProductFilter
@ -151,6 +152,7 @@ class BrandViewSet(EvibesViewSet):
}
@extend_schema_view(**PRODUCT_SCHEMA)
class ProductViewSet(EvibesViewSet):
queryset = Product.objects.prefetch_related("tags", "attributes", "stocks", "images").all()
filter_backends = [DjangoFilterBackend]