|
@@ -65,8 +65,14 @@ class Condition:
|
|
|
"""
|
|
"""
|
|
|
Evaluate the provided data to determine whether it matches the condition.
|
|
Evaluate the provided data to determine whether it matches the condition.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ def _get(obj, key):
|
|
|
|
|
+ if isinstance(obj, list):
|
|
|
|
|
+ return [dict.get(i, key) for i in obj]
|
|
|
|
|
+
|
|
|
|
|
+ return dict.get(obj, key)
|
|
|
|
|
+
|
|
|
try:
|
|
try:
|
|
|
- value = functools.reduce(dict.get, self.attr.split('.'), data)
|
|
|
|
|
|
|
+ value = functools.reduce(_get, self.attr.split('.'), data)
|
|
|
except TypeError:
|
|
except TypeError:
|
|
|
# Invalid key path
|
|
# Invalid key path
|
|
|
value = None
|
|
value = None
|