cubicweb/devtools/fill.py
changeset 11129 97095348b3ee
parent 11080 245f440b814a
parent 11057 0b59724cb3f2
child 11767 432f87a63057
--- a/cubicweb/devtools/fill.py	Thu Feb 11 21:59:49 2016 +0100
+++ b/cubicweb/devtools/fill.py	Wed Feb 17 13:45:34 2016 +0100
@@ -42,6 +42,9 @@
 from cubicweb.schema import RQLConstraint
 
 def custom_range(start, stop, step):
+    if start == stop:
+        yield start
+        return
     while start < stop:
         yield start
         start += step
@@ -214,8 +217,10 @@
         minvalue = maxvalue = None
         for cst in self.eschema.rdef(attrname).constraints:
             if isinstance(cst, IntervalBoundConstraint):
-                minvalue = self._actual_boundary(entity, attrname, cst.minvalue)
-                maxvalue = self._actual_boundary(entity, attrname, cst.maxvalue)
+                if cst.minvalue is not None:
+                    minvalue = self._actual_boundary(entity, attrname, cst.minvalue)
+                if cst.maxvalue is not None:
+                    maxvalue = self._actual_boundary(entity, attrname, cst.maxvalue)
             elif isinstance(cst, BoundaryConstraint):
                 if cst.operator[0] == '<':
                     maxvalue = self._actual_boundary(entity, attrname, cst.boundary)