Commits

Luke Plant committed 1d0f2b1

Added bool source

Comments (0)

Files changed (1)

anonymizer/base.py

 
     ### Public interace ##
 
+    def bool(self, field=None):
+        """
+        Returns a random boolean
+        """
+        source = lambda: bool(randrange(0, 2))
+        return self._get_allowed_value(source, field)
+
     def datetime(self, obj=None, field=None, val=None):
         """
         Returns a random datetime. If 'val' is passed, a datetime within two