Beispiel #1
0
 class PersonSchema(rest.Schema):
     first_name = rest.String()
     last_name = rest.String()
     dob = rest.DateTime()
Beispiel #2
0
 class UserSchema(rest.Schema):
     id = rest.String()
     name = rest.String()
Beispiel #3
0
        class RegexSchema(rest.Schema):
            zip_code = rest.String(
                validators=[rest.regex('[0-9]{5}', 'not a valid Zip')])

            state = rest.String(
                validators=[rest.regex('[A-Z]{2}', 'not a valid State')])
Beispiel #4
0
class FriendSchema(rest.Schema):
    name = rest.String()
    age = rest.Int()
Beispiel #5
0
 class LengthSchema(rest.Schema):
     min_field = rest.String(validators=[rest.length(min=4)])
     max_field = rest.String(validators=[rest.length(max=2)])
Beispiel #6
0
 class CoolSchema(rest.Schema):
     name = rest.String(validators=[rest.required])
Beispiel #7
0
 class NameSchema(rest.Schema):
     first_name = rest.String()
     last_name = rest.String()
Beispiel #8
0
 class PersonSchema(rest.Schema):
     first_name = rest.String(default='John')
     last_name = rest.String(default='Doe')
     money = rest.Dollars(default='10')
Beispiel #9
0
 class CSVSchema(Schema):
     dog_type = rest.String(validators=[rest.nonempty])
     food = rest.String(validators=[rest.nonempty])
     pounds = rest.Int()