33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from marshmallow import fields, validate, Schema
|
|
|
|
from .students import ProjectSupervisorSchema
|
|
|
|
|
|
class ProjectSupervisorQuerySchema(Schema):
|
|
fullname = fields.Str()
|
|
order_by_first_name = fields.Str()
|
|
order_by_last_name = fields.Str()
|
|
page = fields.Integer()
|
|
per_page = fields.Integer()
|
|
|
|
|
|
class ProjectSupervisorsPaginationSchema(Schema):
|
|
project_supervisors = fields.List(fields.Nested(ProjectSupervisorSchema))
|
|
max_pages = fields.Integer()
|
|
|
|
|
|
class ProjectSupervisorCreateSchema(Schema):
|
|
first_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
|
last_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
|
email = fields.Str(validate=[validate.Length(min=1, max=255), validate.Email()], required=True)
|
|
|
|
|
|
class ProjectSupervisorEditSchema(Schema):
|
|
first_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
|
last_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
|
email = fields.Str(validate=[validate.Length(min=0, max=255), validate.Email()], required=True)
|
|
|
|
|
|
class ProjectSupervisorYearGroupSchema(Schema):
|
|
limit_group = fields.Integer(required=True)
|