Hello guys,
I have to update a field'values in model.
sex = fields.Selection([('male','Male')], string='Sex')
How to put a new data into the selection field ?
sex.append(('female','Female')) doesn't work and it tell me
TypeError: list indices must be integers or slices, not str
Thanks
/!\ I have two lists
from collection import Counter
fruits = ['Apple','Banana','Orange','Ananas']
begin_with_a = ['Apple','Ananas'] # denied list
fruits = list(Counter(fruits) - Counter(begin_with_a)).elements() # result [ 'Banana','Orange']
info default_get function, the fields.Selection
fields['fruits'] = [(f.lower(),f) for f in fruits]