📜  django 批量更新 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:08.287000             🧑  作者: Mango

代码示例1
objs = []
for person in p:
    obj = People.objects.get(email=person['email'])
    obj.birthday = person['birthday']
    objs.append(obj)
People.objects.bulk_update(objs, ['birthday'], batch_size=1000)