class SimpleDoc(Document): __collection__ = 'testdocs' oid = ObjectIdField() b = BooleanField() s = StringField() i = IntegerField() e = EmailField() email = StringField()
class Doc(Document): i = IntegerField() s = StringField() def __fake__(self, values, faker, depth): assert values['i'] == 13 assert 's' not in values new_values = values.copy() new_values['i'] += 1 new_values['s'] = 'string' return new_values
class SimpleDoc(Document): __collection__ = 'testdocs' oid = ObjectIdField() b = BooleanField() s = StringField() i = IntegerField() e = EmailField() email = StringField() not_set = StringField() def __fake__email__(self, faker, depth): return faker.email() def __fake__not_set__(self, faker, depth): return AttributeNotSet
class Doc(Document): __collection__ = 'docs' i = IntegerField() s = StringField() ref = ReferenceField(RefDoc)
class Bar(EmbeddedDocument): f = IntegerField(42)
class Doc(Document): __collection__ = 'testdocs' i = IntegerField()