MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / BooleanField

Class BooleanField

mongoengine/fields.py:504–516  ·  view source on GitHub ↗

Boolean field type.

Source from the content-addressed store, hash-verified

502
503
504class BooleanField(BaseField):
505 """Boolean field type."""
506
507 def to_python(self, value):
508 try:
509 value = bool(value)
510 except (ValueError, TypeError):
511 pass
512 return value
513
514 def validate(self, value):
515 if not isinstance(value, bool):
516 self.error("BooleanField only accepts boolean values")
517
518
519class DateTimeField(BaseField):

Callers 15

EvilHumanClass · 0.90
BlogPostClass · 0.90
BookClass · 0.90
PostClass · 0.85
VariousDataClass · 0.85
AnonClass · 0.85
TestDocClass · 0.85
BlogPostClass · 0.85
BClass · 0.85
BlogPostClass · 0.85
TestClass · 0.85
NewsClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected