fix: batchst支持返回source_near修复
This commit is contained in:
parent
e99b2ecbbc
commit
70e49eb27e
|
|
@ -1078,7 +1078,8 @@ class BatchStViewSet(CustomListModelMixin, ComplexQueryMixin, CustomGenericViewS
|
||||||
filterset_class = BatchStFilter
|
filterset_class = BatchStFilter
|
||||||
|
|
||||||
def add_info_for_list(self, data):
|
def add_info_for_list(self, data):
|
||||||
if self.request.query_params.get("with_source_near", None) == "yes":
|
if (self.request.query_params.get("with_source_near", None) == "yes" or
|
||||||
|
self.request.data.get("with_source_near", None) == "yes"):
|
||||||
batchstIds = [ins["id"] for ins in data]
|
batchstIds = [ins["id"] for ins in data]
|
||||||
batchlog_qs = BatchLog.objects.filter(target__id__in=batchstIds).values("id", "source", "target")
|
batchlog_qs = BatchLog.objects.filter(target__id__in=batchstIds).values("id", "source", "target")
|
||||||
source_data = BatchStSerializer(instance=BatchSt.objects.filter(id__in=[ins["source"] for ins in batchlog_qs]), many=True).data
|
source_data = BatchStSerializer(instance=BatchSt.objects.filter(id__in=[ins["source"] for ins in batchlog_qs]), many=True).data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue