Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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'),
... ])
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django #create #multiple #objects
ADD COMMENT
Topic
Name
4+3 =