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')
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')
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')
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')
class UserSchema(ma.Schema): user_id = fields.Integer() name = fields.Str() email = fields.Str() password = fields.Str() blogposts = ma.Nested(blog_schema, many=True) created_on = fields.DateTime()
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()
class DepartmentSchema(ma.SQLAlchemySchema): id = fields.Integer() name = fields.String() created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
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')
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)