Ejemplo n.º 1
0
 def get(self, request):
     singer = request.data
     # print(f"{singer}")
     # print(type(singer))
     musics = Music.objects.filter(singer__name__exact=singer)
     print(musics)
     serializers = MusicSerializer(musics, many=True)
     return Response(serializers.data)
Ejemplo n.º 2
0
 def get(self, request):
     musics = Music.objects.order_by('-view')
     musicSerializes = MusicSerializer(musics, many=True)
     return Response(musicSerializes.data)
Ejemplo n.º 3
0
 def post(self, request):
     key = request.data['key']
     musics = Music.objects.filter(name__contains=key)
     serializers = MusicSerializer(musics, many=True)
     return Response(serializers.data)
Ejemplo n.º 4
0
 def post(self, request):
     singer = request.data['name']
     musics = Music.objects.filter(singer__name__exact=singer)
     serializers = MusicSerializer(musics, many=True)
     return Response(serializers.data)
Ejemplo n.º 5
0
 def get(self, request):
     music = Music.objects.all()
     serializer = MusicSerializer(music, many=True)
     return Response(serializer.data)