1. Luke Plant
  2. django-anonymizer

Commits

Luke Plant  committed 1d0f2b1

Added bool source

  • Participants
  • Parent commits 407173b
  • Branches default

Comments (0)

Files changed (1)

File anonymizer/base.py

View file
 
     ### 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