Corrected boolean value of resource's "age-range" property
authorThierry Florac <tflorac@ulthar.net>
Tue, 22 Jan 2019 15:33:08 +0100
changeset 1251 f9cf2f259316
parent 1250 578f8c122767
child 1252 18df30662df0
Corrected boolean value of resource's "age-range" property
src/pyams_content/shared/resource/schema.py
--- a/src/pyams_content/shared/resource/schema.py	Tue Jan 22 15:19:33 2019 +0100
+++ b/src/pyams_content/shared/resource/schema.py	Tue Jan 22 15:33:08 2019 +0100
@@ -29,9 +29,6 @@
     max_value = Int(title=_("Maximum age"),
                     required=False)
 
-    def __bool__(self):
-        return self.min_value or self.max_value
-
 
 @implementer(IAgeRange)
 class AgeRange(object):
@@ -40,6 +37,9 @@
     min_value = FieldProperty(IAgeRange['min_value'])
     max_value = FieldProperty(IAgeRange['max_value'])
 
+    def __bool__(self):
+        return self.min_value or self.max_value
+
 
 class IAgeRangeField(IObject):
     """Age range schema field interface"""