-1
在我的詳細信息視圖我已經followig結果如何篩選Django rest框架中的嵌套數據?
{ // measure object
"id": 5,
"name": "co",
"averages": [ // list of averages
{
"start": "2016-05-15T12:18:15Z",
"end": "2016-05-15T12:18:16Z",
"value": 22.0,
"length": 4
}
]
}
我需要averages
過濾數據e.g 20 <值到dispay如何實現的呢?
查看:
class MeasuresList(viewsets.ModelViewSet):
serializer_class = serializers.DetailedMeasureSerializer
def get_queryset(self):
return Measure.objects.all()
我需要過濾averaves閱讀它 - 嵌套的測量對象 –