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:
parent
9f64b4214b
commit
9941b45bd3
1 changed files with 2 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ from core.docs.drf.viewsets import (
|
||||||
ATTRIBUTE_VALUE_SCHEMA,
|
ATTRIBUTE_VALUE_SCHEMA,
|
||||||
CATEGORY_SCHEMA,
|
CATEGORY_SCHEMA,
|
||||||
ORDER_SCHEMA,
|
ORDER_SCHEMA,
|
||||||
|
PRODUCT_SCHEMA,
|
||||||
WISHLIST_SCHEMA,
|
WISHLIST_SCHEMA,
|
||||||
)
|
)
|
||||||
from core.filters import BrandFilter, CategoryFilter, OrderFilter, ProductFilter
|
from core.filters import BrandFilter, CategoryFilter, OrderFilter, ProductFilter
|
||||||
|
|
@ -151,6 +152,7 @@ class BrandViewSet(EvibesViewSet):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(**PRODUCT_SCHEMA)
|
||||||
class ProductViewSet(EvibesViewSet):
|
class ProductViewSet(EvibesViewSet):
|
||||||
queryset = Product.objects.prefetch_related("tags", "attributes", "stocks", "images").all()
|
queryset = Product.objects.prefetch_related("tags", "attributes", "stocks", "images").all()
|
||||||
filter_backends = [DjangoFilterBackend]
|
filter_backends = [DjangoFilterBackend]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue