⬆️ Major bumps and django checks
Notably to django 3.2
This commit is contained in:
1 parent
a1437ab5d2
commit
d311e65058
9 files changed
+247
-38
No files matched your search
+2
-3
@@ -1,6 +1,5 @@
|
||||
from rest_framework import mixins
|
||||
from rest_framework.decorators import list_route
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
|
||||
from main.api.serializers import ProductSerializer, ProductStatSerializer
|
||||
@@ -14,7 +13,7 @@ class ProductViewSet(mixins.ListModelMixin,
|
||||
serializer_class = ProductSerializer
|
||||
queryset = Product.objects.all()
|
||||
|
||||
@list_route(methods=['get'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def group_by_user(self, request):
|
||||
products = self.get_queryset().filter(active=True)
|
||||
serializer = ProductStatSerializer(products, many=True)
|
||||
|
||||
Reference in new issue
Block a user