0

how to update multiple fields via

Model.objects.bulk_create(list)

I try it

Model.objects.bulk_create(list).update(startD=startD, endD=endD)

but error show 'list' object has no attribute 'update'

Ailan
  • 1
  • 1
  • 1
    Can you please mention why you are using bulk_create() in the code segment? Do you want to add startD and endD while the bulk create operation is executing? – Sanip Jan 03 '22 at 08:29

1 Answers1

1

you can try this:

Model.objects.update(anythings)

this code will update all of the table from this model

but if you want to update one of the data table of this model try this code:

Model.objects.filter(limit_the_data_table).update(anythings)
phorez
  • 11
  • 3