跳至內容
選單
此問題已被標幟
1 回覆
2712 瀏覽次數

Let's say I have this dictionary returned to me by an api:

{'idnumber': 123, 'balance': 456, 'fee': 789}


I already made a custom read-only field on res.orders and would like to display 'balance' on it. Is there a "correct" way of loading 'balance'? I'm fairly new to python and odoo so all viable ways are welcomed!

頭像
捨棄
最佳答案

hello,

i'm not sure if this is you want

you can use dic['balance']

eg :

dict_eg = {'idnumber': 123, 'balance': 456, 'fee': 789}

print dict_eg['balance']      // this will give 456

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 18
4190
1
1月 20
5299
1
1月 25
10004
3
9月 22
30896
1
11月 18
5632