Commit 7fdbe2c2 authored by clienhar's avatar clienhar

added any() and all() methods to MultiField

not sure if and how the spaces parameter should be passed somehow
parent dfbc582a
Pipeline #36362 passed with stages
in 1 minute and 24 seconds
...@@ -160,6 +160,18 @@ class MultiField(object): ...@@ -160,6 +160,18 @@ class MultiField(object):
return False return False
return True return True
def any(self):
result = False
for field in self._val.values():
result = result or field.any()
return result
def all(self):
result = True
for field in self._val.values():
result = result and field.all()
return result
for op in ["__add__", "__radd__", "__iadd__", for op in ["__add__", "__radd__", "__iadd__",
"__sub__", "__rsub__", "__isub__", "__sub__", "__rsub__", "__isub__",
"__mul__", "__rmul__", "__imul__", "__mul__", "__rmul__", "__imul__",
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