Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6503 Lượt xem

How can i define a dynamic selection field where the user can add new items that are not predefined this code define a static selection field:

score:field.selection([('key1','value1').....],string='score'),

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, try this:

def _dinamic_selection(self):
    list_field = []
    # add elementos to list
    return list_field


_columns = {
    'field_selecction' : fields.selection('_dinamic_selection', 'Dinamic Field Selection'),
}


I hope you help, regards.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 2 25
2621
0
thg 5 24
46
1
thg 4 24
2784
4
thg 9 23
4220
1
thg 8 23
1947