devtools/fill.py
changeset 6884 6fa712e9dfa5
parent 5811 e77cea9721e7
child 6931 0af44a38fe41
--- a/devtools/fill.py	Mon Jan 24 19:09:14 2011 +0100
+++ b/devtools/fill.py	Mon Jan 24 19:09:42 2011 +0100
@@ -157,6 +157,11 @@
         base = date(randint(2000, 2010), 1, 1) + timedelta(randint(1, 365))
         return self._constrained_generate(entity, attrname, base, timedelta(days=1), index)
 
+    def generate_interval(self, entity, attrname, index):
+        """generates a random date (format is 'yyyy-mm-dd')"""
+        base = timedelta(randint(1, 365))
+        return self._constrained_generate(entity, attrname, base, timedelta(days=1), index)
+
     def generate_time(self, entity, attrname, index):
         """generates a random time (format is ' HH:MM')"""
         return time(11, index%60) #'11:%02d' % (index % 60)