答案 0 :(得分:0)
您需要在网址中添加查询参数,例如:
http://example.com/api/ads/?ad_fk=5
在AdsViewer
:
def get_queryset(self):
"""
This view should return a list of all the ads filtered with proper foreign key
"""
ad_fk = self.request.query_params.get('ad_fk', None)
return CADs.objects.filter(ad=ad_fk)
有关详细信息,请参阅doc