Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2686 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июн. 18
4182
1
янв. 20
5290
1
янв. 25
9992
3
сент. 22
30881
1
нояб. 18
5624