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

155 lines
7.1 KiB
Python
Raw Normal View History

from marshmallow import fields, Schema, validate
POINTS = [0, 1, 3, 4]
class ProjectSupervisorSchema(Schema):
first_name = fields.Str()
last_name = fields.Str()
2022-06-13 18:27:30 +02:00
email = fields.Str()
available_groups = fields.Integer()
class ProjectSupervisorPaginationSchema(Schema):
project_supervisors = fields.List(fields.Nested(ProjectSupervisorSchema))
max_pages = fields.Integer()
class ProjectSupervisorQuerySchema(Schema):
page = fields.Integer()
per_page = fields.Integer()
class TemporaryStudentSchema(Schema):
student_index = fields.Integer(required=True)
class MessageSchema(Schema):
message = fields.Str()
class ExaminationScheduleSchema(Schema):
id = fields.Integer()
title = fields.Str()
start_date = fields.DateTime()
end_date = fields.DateTime()
class ExaminationScheduleListSchema(Schema):
examination_schedules = fields.List(fields.Nested(ExaminationScheduleSchema))
class ProjectSupervisorCommitteeSchema(Schema):
id = fields.Integer()
first_name = fields.Str()
last_name = fields.Str()
class TermOfDefenceStudentItemSchema(Schema):
id = fields.Integer()
start_date = fields.DateTime()
end_date = fields.DateTime()
members_of_committee = fields.List(fields.Nested(ProjectSupervisorCommitteeSchema))
class TermOfDefenceStudentListSchema(Schema):
term_of_defences = fields.List(fields.Nested(TermOfDefenceStudentItemSchema))
class YearGroupStudentSchema(Schema):
id = fields.Integer()
name = fields.Str()
mode = fields.Str()
class YearGroupStudentPaginationSchema(Schema):
year_groups = fields.List(fields.Nested(YearGroupStudentSchema))
max_pages = fields.Integer()
class YearGroupQueryStudentSchema(Schema):
index = fields.Integer(required=True) # it will be removed
page = fields.Integer()
per_page = fields.Integer()
class StudentIndexQueryTempSchema(Schema):
index = fields.Integer(required=True) # it will be removed
term = fields.Integer(required=True, validate=validate.OneOf([1, 2]))
class ProjectGradeSheetEditFirstTermSchema(Schema):
presentation_required_content_1 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_was_compatible_1 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_showing_1 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_answers_to_questions_from_committee_1 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_project_vision_1 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_requirements_1 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_for_clients_1 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_for_developers_1 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_license_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_regularity_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_division_of_work_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_contact_with_client_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_management_of_risk_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_work_methodology_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_management_of_source_code_1 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_devops_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_complexity_of_product_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_access_to_application_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_security_issues_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_access_to_test_application_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_acceptance_criteria_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_expected_functionality_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_promises_well_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_has_been_implemented_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_is_useful_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_prototype_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_tests_1 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_technology_1 = fields.Integer(validate=validate.OneOf(POINTS))
class ProjectGradeSheetDetailFirstTermSchema(ProjectGradeSheetEditFirstTermSchema):
id = fields.Integer()
class ProjectGradeSheetEditSecondTermSchema(Schema):
presentation_required_content_2 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_was_compatible_2 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_showing_2 = fields.Integer(validate=validate.OneOf(POINTS))
presentation_answers_to_questions_from_committee_2 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_project_vision_2 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_requirements_2 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_for_clients_2 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_for_developers_2 = fields.Integer(validate=validate.OneOf(POINTS))
documentation_license_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_regularity_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_division_of_work_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_contact_with_client_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_management_of_risk_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_work_methodology_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_management_of_source_code_2 = fields.Integer(validate=validate.OneOf(POINTS))
group_work_devops_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_complexity_of_product_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_access_to_application_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_security_issues_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_access_to_test_application_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_acceptance_criteria_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_expected_functionality_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_promises_well_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_has_been_implemented_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_is_useful_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_prototype_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_tests_2 = fields.Integer(validate=validate.OneOf(POINTS))
products_project_technology_2 = fields.Integer(validate=validate.OneOf(POINTS))
class ProjectGradeSheetDetailSecondTermSchema(ProjectGradeSheetEditSecondTermSchema):
id = fields.Integer()