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

I am trying to get selections for multiple fields from the same method, but I don't find the way to pass the values:

_columns = { 
    'x_standard': fields.selection(selection='_get_selection', string='Standards', required=1),
    'x_pressure': fields.selection(selection='_get_selection', string='Pressure', required=1),
}
def _get_selection(fieldname):
    selection = []
    if fieldname=='x_stanadard':
        selection=[('xxx','xxx')]
    elif fieldname=='x_pressure':
        selection=[('yyy','yyy')]
    return selection

Thanks for any help!

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
дек. 17
16714
1
мар. 15
9387
1
дек. 24
1418
0
июн. 19
3700
1
авг. 18
7942