Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django bulk update

objs = []
for person in p:
    obj = People.objects.get(email=person['email'])
    obj.birthday = person['birthday']
    objs.append(obj)
People.objects.bulk_update(objs, ['birthday'], batch_size=1000)
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django #bulk #update
ADD COMMENT
Topic
Name
3+2 =