Esempio n. 1
0
class SimpleDoc(Document):
    __collection__ = 'testdocs'

    oid = ObjectIdField()
    b = BooleanField()
    s = StringField()
    i = IntegerField()
    e = EmailField()
    email = StringField()
Esempio n. 2
0
    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
Esempio n. 3
0
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
Esempio n. 4
0
class Doc(Document):
    __collection__ = 'docs'

    i = IntegerField()
    s = StringField()
    ref = ReferenceField(RefDoc)
Esempio n. 5
0
class Bar(EmbeddedDocument):
    f = IntegerField(42)
Esempio n. 6
0
class Doc(Document):
    __collection__ = 'testdocs'
    i = IntegerField()