📜  django createmany - Python 代码示例

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

代码示例1
>>> Category.objects.all().count()
2
>>> Category.objects.bulk_create(
    [Category(name="God"),
     Category(name="Demi God"),
     Category(name="Mortal")]
)
[, , ]
>>> Category.objects.all().count()
5