Commit d89509ac authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type: use constraints accessors in _filteredConstraintList

Constraints are supposed to have a getReference and getConstraintType
methods.
parent a198f5b8
...@@ -2669,13 +2669,13 @@ class Base( CopyContainer, ...@@ -2669,13 +2669,13 @@ class Base( CopyContainer,
reference_list = filt.get('reference', None) reference_list = filt.get('reference', None)
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 \ constraints = filter(lambda x:x.getReference() in \
reference_list, constraints) reference_list, constraints)
if 'constraint_type' in filt: if 'constraint_type' in filt:
constraint_type_list = filt.get('constraint_type', None) constraint_type_list = filt.get('constraint_type', None)
if not isinstance(constraint_type_list, (list, tuple)): if not isinstance(constraint_type_list, (list, tuple)):
constraint_type_list = [constraint_type_list] constraint_type_list = [constraint_type_list]
constraints = filter(lambda x:x.__of__(self).getProperty('constraint_type') in \ constraints = filter(lambda x:x.__of__(self).getConstraintType() in \
constraint_type_list, constraints) constraint_type_list, constraints)
return constraints return constraints
......
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