Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2690 Zobrazení

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!

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvn 18
4185
1
led 20
5291
1
led 25
9997
3
zář 22
30883
1
lis 18
5624