示例#1
0
    class Person(models.Base):

        name = fields.StringField(required=True,
                                  validators=[validator1, validator2])
        surname = fields.StringField(required=True)
        age = fields.IntField(validators=validator3)
        cash = fields.FloatField()
 class Person(models.Base):
     name = fields.StringField(default=default_name)
     age = fields.IntField(default=default_age)
     height = fields.FloatField(default=default_height)
     job = fields.EmbeddedField(Job, default=default_job)
     hobbies = fields.ListField(items_types=str, default=default_hobbies)
     last_ate = fields.TimeField(default=default_last_ate)
     birthday = fields.DateField(default=default_birthday)
     time_of_death = fields.DateTimeField(default=default_time_of_death)
示例#3
0
    class Person(models.Base):

        name = fields.StringField(required=True)
        surname = fields.StringField(required=True)
        age = fields.IntField()
        cash = fields.FloatField()
示例#4
0
    class Laptop(models.Base):

        name = fields.StringField()
        battery_voltage = fields.FloatField()
示例#5
0
    class Lamborghini(models.Base):

        brand = fields.StringField()
        velocity = fields.FloatField()
示例#6
0
    class Viper(models.Base):

        brand = fields.StringField()
        capacity = fields.FloatField()
class File(models.Base):

    name = fields.StringField()
    size = fields.FloatField()
    class Person(models.Base):

        name = fields.StringField()
        surname = fields.StringField()
        age = fields.IntField()
        cash = fields.FloatField()
示例#9
0
    class Person(models.Base):

        name = fields.StringField()
        age = fields.IntField()
        cash = fields.FloatField()
        children = fields.ListField()
示例#10
0
 class Wheel(models.Base):
     pressure = fields.FloatField()