コンテンツへスキップ
メニュー
この質問にフラグが付けられました
11197 ビュー

To gain performance I want to write multiple records at once.

For example, I already filtered list of partner_ids and I want to write different values to different partners.

What should I do?

Pass list of dicts to write function like this?


partner_ids.write([
     {'id': 1, 'email': 'asd@zxc'},
     {'id': 2, 'fax': '13456'},
{'id': 10, 'street': ''},
])
アバター
破棄

Gain performance ... ? Can you explain to me how you can do it in sql with only one request ? ;)

Orm will just translate your 'python' code to sql ...

著作者

Looks like it's not possible. Thanks)

関連投稿 返信 ビュー 活動
3
5月 20
7788
0
9月 19
98
1
7月 17
4205
3
12月 23
19817
4
8月 16
8411