📜  django 创建多个对象 - Python 代码示例

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

代码示例1
# to add multiple objects at once use 'bulk_create'

>>> objs = Entry.objects.bulk_create([
...     Entry(headline='This is a test'),
...     Entry(headline='This is only a test'),
... ])