Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
7117 Zobrazení

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'),

Avatar
Zrušit
Nejlepší odpověď

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
úno 25
3639
0
kvě 24
46
1
dub 24
3394
4
zář 23
4895
1
srp 23
2578