代码: with transaction.atomic(): for i in xrange(int(svc_instance_num)): tmp_fileprotect_svc_instance = FILE_PROTECT_INSTANCE(customer_id=customer_id, order_id=order_id, svc_id=svc_id, svc_profile_list=json.dumps(svc_profile_list), svc_instance_num=svc