# 13、ORM批量添加||更新数据

### 批量添加

![](https://2134947750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvILwbD2PrkBCkSitM3m4%2Fuploads%2FHfUcGGe3ckgOXJILIQVf%2Fimage-20220106171406464.png?alt=media\&token=b98d7cdf-5ad7-4c65-8e92-2409e973f098)

### 批量更新

* 批量更新符合parentcode=ori\_code的字段

```
MyModel.objects.filter(parentcode=ori_code).update(parentcode=new_code)
```

\
