consider vocabulary of Int fields 3.0
authorsylvain.thenault@logilab.fr
Thu, 15 Jan 2009 13:25:46 +0100
branch3.0
changeset 428 7d80331a91d7
parent 427 e894eec21a1b
child 429 10854a2f9c03
consider vocabulary of Int fields
devtools/fill.py
--- a/devtools/fill.py	Thu Jan 15 13:25:34 2009 +0100
+++ b/devtools/fill.py	Thu Jan 15 13:25:46 2009 +0100
@@ -136,6 +136,9 @@
         
     def generate_integer(self, attrname, index):
         """generates a consistent value for 'attrname' if it's an integer"""
+        choosed = self.generate_choice(attrname, index)
+        if choosed is not None:
+            return choosed
         minvalue, maxvalue = get_bounds(self.e_schema, attrname)
         if maxvalue is not None and maxvalue <= 0 and minvalue is None:
             minvalue = maxvalue - index # i.e. randint(-index, 0)