system-pri/backend/app/examination_schedule/schemas.py

41 lines
951 B
Python

from marshmallow import fields, validate, Schema
class ProjectSupervisorSchema(Schema):
first_name = fields.Str()
last_name = fields.Str()
class CommitteeSchema(Schema):
members = fields.List(fields.Nested(ProjectSupervisorSchema))
class GroupSchema(Schema):
name = fields.Str()
class EnrollmentSchema(Schema):
start_date = fields.DateTime()
end_date = fields.DateTime()
committee = fields.Nested(CommitteeSchema)
group = fields.Nested(GroupSchema)
class EnrollmentPaginationSchema(Schema):
enrollments = fields.List(fields.Nested(EnrollmentSchema))
max_pages = fields.Integer()
class EnrollmentQuerySchema(Schema):
page = fields.Integer()
per_page = fields.Integer()
class ExaminationScheduleSchema(Schema):
id = fields.Integer()
title = fields.Str()
class ExaminationScheduleListSchema(Schema):
examination_schedules = fields.List(fields.Nested(ExaminationScheduleSchema))