Answers for "django create multiple objects"

0

django create multiple objects

# 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'),
... ])
Posted by: Guest on August-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language