class HistoryView(ListAPIView):
permission_classes = (IsAuthenticated,)
serializer_class = serializers.private.HistorySerializer
model = serializer_class.Meta.model
def get_queryset(self):
user = self.request.user
queryset = self.model.objects.filter(Q(user_1=user) | Q(user_2=user))
return queryset
class HistorySerializer(ModelSerializer):
class Meta:
model = models.exchange.History
fields = [
'date',
'type',
'name',
]
Возвращает:
[
{
"date": 1555690476.155725,
"type": false,
"name": "name",
},
.......
.......
]
Как я могу получить данные в виде массива массивов?
[
[1555690476.155725, false, "name"],
[...],
...
],