django 获取当前筛选条件下的queryset,获取serializer之后的数据
手动获取筛选结果
queryset = self.filter_queryset(self.get_queryset())
手动序列化
objs = StockLackPicking.objects.using('read_default').filter(id__in=ids)
serializers = StockLackPickingSerializer(objs, many=True)
serializers_data = serializers.data
data_dict = {}
from utils.common import handel_utc_time
for data in serializers_data:
data['create_date'] = handel_utc_time(data['create_date'])
data['actual_date'] = handel_utc_time(data['actual_date'])
order_id = data['id']
data_dict[order_id] = data
本文来自博客园,作者:那时一个人,转载请注明原文链接:https://www.cnblogs.com/qianxunman/p/14358122.html