Commit 9fb35f98 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Base: Allow to ignore Constraints by their reference.

Only Constraints to be kept could be specified by reference, but sometimes
it is convenient to apply all Constraints but one.
parent f8d31d2c
...@@ -2592,6 +2592,12 @@ class Base( CopyContainer, ...@@ -2592,6 +2592,12 @@ class Base( CopyContainer,
if not isinstance(reference_list, (list, tuple)): if not isinstance(reference_list, (list, tuple)):
reference_list = [reference_list] reference_list = [reference_list]
constraints = filter(lambda x:x.getProperty('reference') in reference_list, constraints) constraints = filter(lambda x:x.getProperty('reference') in reference_list, constraints)
if 'ignore_reference' in filt:
ignore_reference_list = filt.get('ignore_reference', None)
if not isinstance(ignore_reference_list, (list, tuple)):
ignore_reference_list = [ignore_reference_list]
constraints = filter(lambda x:x.getProperty('reference') not in ignore_reference_list, constraints)
return constraints return constraints
# Context related methods # Context related methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment