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

Hello,

One of my context keys contains multiple ids that I am going to use in a python method. What I am trying to do is get each of those ids from the context key, into an array so I can use it in my method. So far this is what I am doing:

ids = context.get('list_of_ids')

Now the value that is being returned to ids is this: [[6, False, [3, 13481]]]

I dont know why the 6, and the False are there, but the 3, and the 13481 are the ids I want to get into the ids variable. Does anyone know how I can get just the 3, and the 13481 ids?

Аватар
Отменить

ids = context.get('list_of_ids')[0][2]

6 it's because you are pulling a one2many or many2many. I'm not sure.. So this has some additional codes.

Автор

Thank you Grover. Your answer is greatly appreciated

Related Posts Ответы Просмотры Активность
1
янв. 25
1869
0
июл. 22
2955
3
сент. 20
3574
2
дек. 15
5273
0
мар. 15
3883