restful 在接口中获取 传过来的值
# 竞价 GET: http://www.xxx.com/deposit/?item_id=1 # 提交竞价 POST: http://www.xxx.com/deposit/ class BidView(ListAPIView, CreateAPIView): queryset = models.BidRecord.objects.all() serializer_class = BidModelSerializer def get_queryset(self): item_id = self.request.query_params.get('item_id') return self.queryset.filter(item_id=item_id)