How to get field value from string python expression in python 3.5

221 Views Asked by At

for example,my string python expression is:

res = ''
for item in object.order_line:res = res + item.product_id.name + ','result = res[:-1]

so i want to get the value of product_id.name while execute my python expression,

1

There are 1 best solutions below

0
On

res = res + item['product_id']['name'] + ','