how to update multiple fields via

135 views Asked by At

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'

1

There are 1 answers

0
phorez On

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)