Skip to content
Snippets Groups Projects
  • Raphael Collet's avatar
    e95fc488
    [IMP] fields: add mechanism to extend a selection field · e95fc488
    Raphael Collet authored
    If a selection field is defined by a list as selection, such as:
    
        state = fields.Selection([('a', 'A'), ('b', 'B')])
    
    one can extend it by inheritance by redefining the field, as:
    
        state = fields.Selection(selection_add=[('c', 'C')])
    
    The result is that the selection field will have the list
    [('a', 'A'), ('b', 'B'), ('c', 'C')] as selection.
    e95fc488
    History
    [IMP] fields: add mechanism to extend a selection field
    Raphael Collet authored
    If a selection field is defined by a list as selection, such as:
    
        state = fields.Selection([('a', 'A'), ('b', 'B')])
    
    one can extend it by inheritance by redefining the field, as:
    
        state = fields.Selection(selection_add=[('c', 'C')])
    
    The result is that the selection field will have the list
    [('a', 'A'), ('b', 'B'), ('c', 'C')] as selection.
fields.py 61.51 KiB