示例#1
0
class Doc(Document):
    __collection__ = 'testdoc'
    e = fields.SimpleEmbeddedDocumentField({
        'i':
        fields.IntegerField(),
        's':
        fields.StringField(default='default value'),
    })
示例#2
0
class Doc(Document):
    __collection__ = 'testdocs'

    i = fields.IntegerField()
    s = fields.StringField()
    e = fields.EmbeddedDocumentField(EDoc)

    extra_class_value = 'value'
示例#3
0
class EDoc(EmbeddedDocument):
    i = fields.IntegerField()
    s = fields.StringField()
示例#4
0
class Doc(Document):
    __collection__ = 'testdocs'
    i = fields.IntegerField()
    s = fields.StringField()
示例#5
0
class Doc(Document):
    __collection__ = 'testdocs'
    b = fields.BooleanField()
    i = fields.IntegerField()
    l = fields.ListField(fields.IntegerField())
示例#6
0
class Doc(Document):
    __collection__ = 'testdoc'
    li = fields.ListField(fields.IntegerField())
示例#7
0
class Doc(Document):
    __collection__ = 'testdoc'
    s = fields.SetField(fields.IntegerField())
示例#8
0
 class ETD(EmbeddedDocument):
     i = fields.IntegerField()
示例#9
0
class Doc(Document):
    __collection__ = 'testdocs'
    i = fields.IntegerField()
    ref = fields.ReferenceField(DocRef)
示例#10
0
class Doc(Document):
    __collection__ = 'docs'
    i = fields.IntegerField()
示例#11
0
 class Doc(Document):
     i = fields.IntegerField(smart_null=True)
     s = fields.StringField()
示例#12
0
 class DocNotObjectIdRef(Document):
     __collection__ = 'testdocs_ref'
     _id = fields.IntegerField()
示例#13
0
class Doc(Document):
    __collection__ = 'testdoc'
    map = fields.MapField(fields.IntegerField())
示例#14
0
 class RefDoc(Document):
     __collection__ = 'refs'
     i = fields.IntegerField()
示例#15
0
class DocCustom(Document):
    __collection__ = 'testdoc'
    map = fields.MapCustomKeysField(fields.IntegerField(), ObjectId)
示例#16
0
class Doc(Document):
    __collection__ = 'testdocs'
    i = fields.IntegerField()
    b = fields.BooleanField()
示例#17
0
class RDoc(Document):
    __collection__ = 'testrdocs'
    i = fields.IntegerField()
示例#18
0
class EDocOne(EmbeddedDocument):
    type = fields.StringField(default='one')
    i = fields.IntegerField()
示例#19
0
class DocRef(Document):
    __collection__ = 'testdocs_ref'
    i = fields.IntegerField()
示例#20
0
 class Doc(Document):
     __collection__ = 'testdoc'
     li = fields.ListField(fields.IntegerField(), auto_create=False)
示例#21
0
class EDoc(EmbeddedDocument):
    id = fields.ObjectIdField(default_gen=True)
    i = fields.IntegerField()
    s = fields.StringField(default='default')
    e = fields.EmbeddedDocumentField('self')
 class TestEDoc(EmbeddedDocument):
     i = fields.IntegerField()