PWeb DTO or Form
A DTO (Data Transfer Object) is an object used to transfer data between different layers or components of an application. DTOs are often used to pass data between the Model to consumer.
PWeb used Marshmallow for data validation, serialization and deserialization.
class PersonDetailsDTO(PWebRestDTO):
firstname = fields.String(required=True, error_messages={"required": "Please enter first name"})
lastname = fields.String(allow_none=True)
email = fields.Email(required=True, error_messages={"required": "Please enter email."})
income = fields.Float(allow_none=True)