2022-11-12 16:18:07 +01:00
|
|
|
from marshmallow import fields, validate, Schema
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
from .students import ProjectSupervisorSchema
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorQuerySchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
fullname = fields.Str()
|
|
|
|
order_by_first_name = fields.Str()
|
|
|
|
order_by_last_name = fields.Str()
|
|
|
|
page = fields.Integer()
|
|
|
|
per_page = fields.Integer()
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorsPaginationSchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
project_supervisors = fields.List(fields.Nested(ProjectSupervisorSchema))
|
|
|
|
max_pages = fields.Integer()
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorCreateSchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
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), required=True)
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorEditSchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
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=11), required=True)
|
2022-11-12 16:18:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectSupervisorYearGroupSchema(Schema):
|
|
|
|
limit_group = fields.Integer(required=True)
|