Exemple #1
0
 def get(self, request, country, city, format=None):
     print(country)
     print(city)
     products = Product.objects.filter(
         country__name__contains=country).filter(city__name__contains=city)
     serializer = ProductListSerializer(products, many=True)
     return Response(serializer.data)
Exemple #2
0
 def get(self, request, format=None):
     products = Product.objects.filter(category__contains='여행편의')[:6]
     serializer = ProductListSerializer(products, many=True)
     return Response(serializer.data)
Exemple #3
0
 def get(self, request, format=None):
     products = Product.objects.all()
     serializer = ProductListSerializer(products, many=True)
     return Response(serializer.data)