Django orm common routines

 

01 batch updates,: Father has a foreign key Son_id Son pointing to cases of this object, filter by "" __ ", update it with anyone who will Yes

  Father.objects.filter(Son___id = 1).update(Son_id = 2)

 

Guess you like

Origin www.cnblogs.com/daysn/p/11544604.html