列表解析代替 for 循环会更快
try:
category = Category.objects.get(name=singledata.enter.get("6930697000004"))
except:
category = Category.objects.last()
create_list = []
run_data = singledata.data
for j in run_data:
j["category"] = category
create_list.append(CollectionStat(**j))
# todo 列表解析代替 for 循环会更快
# create_list = [CollectionStat(category=category,**j) for j in run_data]
CollectionStat.objects.bulk_create(create_list)