def post(self, request, format=None): serializer = GeneroSerializers(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)
def get(self, request, format=None): print("Metodo get filter") queryset = modelGenero.objects.filter(delete=False) serializer = GeneroSerializers(queryset, many=True) return Response(serializer.data)
def get(self, request, format=None): print("Metodo get filter genero") queryset = Genero.objects.filter(delete=False) #many = true si aplica si retorno multiples objetos serializer = GeneroSerializers(queryset, many=True) return Response(serializer.data)