Пример #1
0
 def create(self, request, *args, **kwargs):
     serializer = BatchFileSerializer(data=request.data)
     if serializer.is_valid():
         batch_file = serializer.create()
         serializer = BatchFileSerializer(instance=batch_file)
         return Response(data=serializer.data, status=status.HTTP_201_CREATED)
     else:
         return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Пример #2
0
 def create(self, request, *args, **kwargs):
     serializer = BatchFileSerializer(data=request.data)
     if serializer.is_valid():
         batch_file = serializer.create()
         serializer = BatchFileSerializer(instance=batch_file)
         return Response(data=serializer.data, status=status.HTTP_201_CREATED)
     else:
         raise serializers.ValidationError(detail=serializer.errors)
Пример #3
0
 def create(self, request, *args, **kwargs):
     serializer = BatchFileSerializer(data=request.data)
     if serializer.is_valid():
         batch_file = serializer.create()
         serializer = BatchFileSerializer(instance=batch_file)
         return Response(data=serializer.data, status=status.HTTP_201_CREATED)
     else:
         raise serializers.ValidationError(detail=serializer.errors)
Пример #4
0
 def create(self, request, *args, **kwargs):
     serializer = BatchFileSerializer(data=request.data)
     if serializer.is_valid():
         batch_file = serializer.create()
         serializer = BatchFileSerializer(instance=batch_file)
         return Response(data=serializer.data,
                         status=status.HTTP_201_CREATED)
     else:
         return Response(serializer.errors,
                         status=status.HTTP_400_BAD_REQUEST)