Exemplo n.º 1
0
class RestaurantSchema(ma.Schema):
    business_id = fields.String()
    name = fields.String()
    is_open = fields.Integer()
    food_type = fields.List(fields.String())
    URL = fields.String()
    location = fields.Nested(LocationSchema)
    menus = fields.Nested(MenuItemSchema)
Exemplo n.º 2
0
class UserSchema(ma.SQLAlchemySchema):
    id = fields.Integer()
    name = fields.String(validate=must_not_be_blank)
    surname = fields.String(validate=must_not_be_blank)
    email = fields.Email(validate=must_not_be_blank)
    username = fields.String(validate=must_not_be_blank)
    password = fields.String(validate=must_not_be_blank)
    role_id = fields.Integer(data_key='roleId', validate=must_not_be_blank)
    department_id = fields.Integer(
        data_key='departmentId', validate=must_not_be_blank)
    address_id = fields.Integer(
        data_key='addressId', validate=must_not_be_blank)
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 3
0
class AddressSchema(ma.SQLAlchemySchema):
    id = fields.Integer()
    street_name = fields.String(
        data_key='streetName', validate=must_not_be_blank)
    city_id = fields.Integer(data_key='cityId', validate=must_not_be_blank)
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 4
0
class CitySchema(ma.SQLAlchemyAutoSchema):
    id = fields.Integer()
    name = fields.String(validate=must_not_be_blank)
    country_id = fields.Integer(
        data_key="countryId", validate=must_not_be_blank)
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 5
0
class AreaSchema(Schema):
    id = fields.Integer()
    name = fields.String()
    districts = ma.Nested('self', only=('id', 'name'))

    class Meta:
        fields = ('id', 'name', 'districts')
Exemplo n.º 6
0
class XssSchema():
    id = fields.Integer()
    user_id = fields.Integer(data_key='userId', validate=must_not_be_blank)
    text = fields.String(data_key="text", validate=must_not_be_blank)
    value = fields.Float(data_key='value', validate=must_not_be_blank)
    is_sqli = fields.Boolean(data_key='isSqli', validate=must_not_be_blank)
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 7
0
class UserSchema(ma.Schema):
    id = fields.Integer()
    name = fields.String(required=True)
    phone_number = fields.String(required=True)
    email = fields.String(required=True)
    sex = fields.String()
    age = fields.String()
    location = fields.String(required=True)
    created_date = fields.DateTime()
Exemplo n.º 8
0
class DepartmentSchema(ma.SQLAlchemySchema):
    id = fields.Integer()
    name = fields.String()
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 9
0
class RoleSchema(ma.SQLAlchemySchema):
    id = fields.Integer()
    name = fields.String(validate=must_not_be_blank)
    created_on = fields.DateTime(data_key='createdOn')
    updated_on = fields.DateTime(data_key='updatedOn')
Exemplo n.º 10
0
class UserSchema(ma.Schema):
    id = fields.Integer(dump_only=True, )
    username = fields.String(required=True, validate=Length(min=5, max=255))
    password = fields.String(required=True, validate=Length(min=8, max=255))
    creation = fields.DateTime('%y %m %d', required=True, dump_only=True)
Exemplo n.º 11
0
class JobSchema(ma.Schema):
    id = fields.String()
    name = fields.String()
    status = fields.String()
    tasks = fields.Nested(TaskSchema, many=True)
Exemplo n.º 12
0
class TaskSchema(ma.Schema):
    id = fields.String()
    name = fields.String()
Exemplo n.º 13
0
class MachineSchema(ma.Schema):
    id = fields.String()
    name = fields.String()
    type = fields.String()
    enabled = fields.String()
    running = fields.String()
Exemplo n.º 14
0
class LocationSchema(ma.Schema):
    address = fields.String()
    city = fields.String()
    post_code = fields.String()
Exemplo n.º 15
0
class MenuItemSchema(ma.Schema):
    name = fields.String()
    description = fields.String()
    price = fields.String()