예제 #1
0
 class TD2(BaseDoc):
     required_field2 = StringField(required=True)
     default_field2 = StringField(default='df2')
     choices_field2 = StringField(choices=ContactStatus)
     simple_field2 = StringField()
예제 #2
0
 class TD3(TD1, TD2):
     required_field3 = StringField(required=True)
     default_field3 = StringField(default='df3')
     choices_field3 = StringField(choices=ContactStatus)
     simple_field3 = StringField()
예제 #3
0
 class TD(BaseDoc):
     field1 = StringField(required=True)
예제 #4
0
 class ITD(BaseDoc):
     int_field = IntField()
     string_field = StringField()
예제 #5
0
 class _TestModel(BaseDoc):
     field1 = StringField(required=True)
     field2 = DateTimeField(default=datetime.now)
예제 #6
0
 class TD(BaseDoc):
     field1 = StringField(validators=[EmailValidator()])
예제 #7
0
 class TD1(BaseDoc):
     field1 = StringField()
예제 #8
0
 class TD(BaseDoc):
     field1 = ListField(StringField())
예제 #9
0
 class TD(BaseDoc):
     field1 = StringField()
     field2 = DictField(DocumentField(InDictTD))
예제 #10
0
 class TD(BaseDoc):
     field1 = StringField()
     field2 = IntField()
     field3 = DocumentField(ITD)
예제 #11
0
 class TD(BaseDoc):
     field1 = StringField()
     field2 = ListField(DocumentField(ITD))
예제 #12
0
 class ITD(BaseDoc):
     field1 = StringField(default='ts')
예제 #13
0
 class ITD(BaseDoc):
     field1 = StringField(default='test_string')
     field2 = StringField()
예제 #14
0
 class TD(BaseDoc):
     field1 = StringField(required=True, default='test_string')
     field2 = BooleanField(required=True, default=False)
     field3 = StringField(default='test_string')
예제 #15
0
 class Foo(BaseDoc):
     bar = StringField()
예제 #16
0
 class TD(BaseDoc):
     field1 = StringField(required=True, default='test_string')
     field2 = DateTimeField(default=datetime.now)
     field3 = UUIDField(default=uuid.uuid4)
     field4 = ObjectIdField(default=ObjectId)
예제 #17
0
class FooDoc(DocWithLifeCycle):
    objects = Collection(db_name='main', collection_name='testmodel')

    bar = StringField()