コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3977 ビュー

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!

アバター
破棄
関連投稿 返信 ビュー 活動
2
12月 17
16949
1
3月 15
9519
1
12月 24
1601
0
6月 19
3811
1
8月 18
8079