215 |
215 |
216 def get_bounds(self, entity, attrname): |
216 def get_bounds(self, entity, attrname): |
217 minvalue = maxvalue = None |
217 minvalue = maxvalue = None |
218 for cst in self.eschema.rdef(attrname).constraints: |
218 for cst in self.eschema.rdef(attrname).constraints: |
219 if isinstance(cst, IntervalBoundConstraint): |
219 if isinstance(cst, IntervalBoundConstraint): |
220 minvalue = self._actual_boundary(entity, attrname, cst.minvalue) |
220 if cst.minvalue is not None: |
221 maxvalue = self._actual_boundary(entity, attrname, cst.maxvalue) |
221 minvalue = self._actual_boundary(entity, attrname, cst.minvalue) |
|
222 if cst.maxvalue is not None: |
|
223 maxvalue = self._actual_boundary(entity, attrname, cst.maxvalue) |
222 elif isinstance(cst, BoundaryConstraint): |
224 elif isinstance(cst, BoundaryConstraint): |
223 if cst.operator[0] == '<': |
225 if cst.operator[0] == '<': |
224 maxvalue = self._actual_boundary(entity, attrname, cst.boundary) |
226 maxvalue = self._actual_boundary(entity, attrname, cst.boundary) |
225 else: |
227 else: |
226 minvalue = self._actual_boundary(entity, attrname, cst.boundary) |
228 minvalue = self._actual_boundary(entity, attrname, cst.boundary) |