[IMP] fields: in selection fields, 'selection_add' only adds options not in selection yet

This commit is contained in:
Raphael Collet 2015-02-11 12:02:21 +01:00
parent 75ca4f8b71
commit 13b36ac677
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@
""" High-level objects for fields. """
from collections import OrderedDict
from datetime import date, datetime
from functools import partial
from operator import attrgetter
@ -1269,7 +1270,9 @@ class Selection(Field):
if 'selection' in field._attrs:
selection = field._attrs['selection']
if 'selection_add' in field._attrs:
selection = selection + field._attrs['selection_add']
# use an OrderedDict to update existing values
selection_add = field._attrs['selection_add']
selection = OrderedDict(selection + selection_add).items()
else:
selection = None
self.selection = selection