示例#1
0
 def post(self, request, format=None):
     serializer = EstadoSerializers(data=request.data)
     if serializer.is_valid():
         serializer.save()
         datas = serializer.data
         return Response(datas)
     return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
示例#2
0
 def get(self, request, format=None):
     print("Metodo get filter")
     queryset = modelEstado.objects.filter(delete=False)
     serializer = EstadoSerializers(queryset, many=True)
     return Response(serializer.data)
示例#3
0
 def get(self, request, format=None):
     print("Metodo get filter estado")
     queryset = Estado.objects.filter(delete=False)
     #many = true si aplica si retorno multiples objetos
     serializer = EstadoSerializers(queryset, many=True)
     return Response(serializer.data)