Ejemplo n.º 1
0
 class Doc(Document):
     dl = fields.IntField()
     do = fields.IntField(dump_only=True)
     lo = fields.IntField(load_only=True)
     nope = fields.IntField(dump_only=True, load_only=True)
Ejemplo n.º 2
0
        class NonStrictEmbeddedDoc(EmbeddedDocument):
            a = fields.IntField()

            class Meta:
                strict = False
Ejemplo n.º 3
0
 class EmbeddedDoc(EmbeddedDocument):
     io_field = fields.IntField(io_validate=io_validate)
Ejemplo n.º 4
0
 class ConcreteGrandChild(AbstractChild):
     d = fields.IntField()
Ejemplo n.º 5
0
 class MyChildEmbeddedDocument(EmbeddedDocument):
     num = fields.IntField()
Ejemplo n.º 6
0
        class AbstractParent(EmbeddedDocument):
            a = fields.IntField(attribute='in_mongo_a_parent')
            b = fields.IntField()

            class Meta:
                abstract = True
Ejemplo n.º 7
0
        class AbstractChild(AbstractParent):
            a = fields.IntField(attribute='in_mongo_a_child')
            c = fields.IntField()

            class Meta:
                abstract = True
Ejemplo n.º 8
0
 class InheritanceSearchParent(Document):
     pf = fields.IntField()
Ejemplo n.º 9
0
 class InheritanceSearchChild1(InheritanceSearchParent):
     c1f = fields.IntField()
Ejemplo n.º 10
0
 class UniqueIndexDoc(Document):
     not_unique = fields.StrField(unique=False)
     sparse_unique = fields.IntField(unique=True)
     required_unique = fields.IntField(unique=True, required=True)
Ejemplo n.º 11
0
 class UniqueIndexParentDoc(Document):
     not_unique = fields.StrField(unique=False)
     unique = fields.IntField(unique=True)
Ejemplo n.º 12
0
            class SimpleIndexDoc(Document):
                indexed = fields.StrField()
                no_indexed = fields.IntField()

                class Meta:
                    indexes = ['indexed']
Ejemplo n.º 13
0
 class Person(PrePostHooksMixin, Document):
     name = fields.StrField()
     age = fields.IntField()
Ejemplo n.º 14
0
 class Accessory(MyEmbeddedDocument):
     brief = fields.StrField()
     value = fields.IntField()
Ejemplo n.º 15
0
 class EmbeddedChild(EmbeddedParent):
     a = fields.IntField(attribute='in_mongo_a_child')
     c = fields.IntField()
Ejemplo n.º 16
0
        class InheritanceSearchParent(Document):
            pf = fields.IntField()

            class Meta:
                collection = db.inheritance_search
                allow_inheritance = True
Ejemplo n.º 17
0
 class GrandChild(EmbeddedChild):
     d = fields.IntField()
Ejemplo n.º 18
0
        class InheritanceSearchChild1(InheritanceSearchParent):
            c1f = fields.IntField()

            class Meta:
                allow_inheritance = True
Ejemplo n.º 19
0
 class MyEmbeddedDocument(EmbeddedDocument):
     a = fields.IntField(attribute='in_mongo_a')
     b = fields.IntField()
Ejemplo n.º 20
0
 class InheritanceSearchChild1Child(InheritanceSearchChild1):
     sc1f = fields.IntField()
Ejemplo n.º 21
0
        class ConcreteChild(AbstractParent, AlienClass):
            c = fields.IntField()

            class Meta:
                allow_inheritance = True
Ejemplo n.º 22
0
 class InheritanceSearchChild2(InheritanceSearchParent):
     c2f = fields.IntField(required=True)
Ejemplo n.º 23
0
 class ConcreteConcreteGrandChild(ConcreteChild):
     d = fields.IntField()
Ejemplo n.º 24
0
 class MyEmbeddedDocument(EmbeddedDocument):
     a = fields.IntField()
Ejemplo n.º 25
0
 class StrictEmbeddedDoc(EmbeddedDocument):
     a = fields.IntField()
Ejemplo n.º 26
0
 class MyDoc(Document):
     e = fields.EmbeddedField(MyEmbeddedDocument)
     l = fields.ListField(fields.EmbeddedField(MyEmbeddedDocument))
     b = fields.IntField(required=True)
Ejemplo n.º 27
0
 class Dummy(Document):
     required_name = fields.StrField(required=True)
     always_io_fail = fields.IntField(io_validate=io_validate)
Ejemplo n.º 28
0
 class EmbeddedParent(EmbeddedDocument):
     a = fields.IntField(attribute='in_mongo_a_parent')
     b = fields.IntField()
Ejemplo n.º 29
0
 class IOStudent(Student):
     io_field = fields.ListField(
         fields.IntField(io_validate=io_validate))
Ejemplo n.º 30
0
        class Doc(Document):
            a = fields.IntField()

            @property
            def prop(self):
                return "I'm a property !"