diff --git a/backend/app/api.py b/backend/app/api.py index 1524d99..93b0650 100644 --- a/backend/app/api.py +++ b/backend/app/api.py @@ -1,7 +1,9 @@ from flask import Blueprint from .coordinator.routes import bp as coordinator_bp +from .project_supervisor.routes import bp as project_supervisor_bp api_bp = Blueprint('api', __name__, url_prefix='/api') # register blueprints here api_bp.register_blueprint(coordinator_bp) +api_bp.register_blueprint(project_supervisor_bp) diff --git a/backend/app/coordinator/routes/__init__.py b/backend/app/coordinator/routes/__init__.py index 6a481bc..6252558 100644 --- a/backend/app/coordinator/routes/__init__.py +++ b/backend/app/coordinator/routes/__init__.py @@ -1,7 +1,7 @@ -from apiflask import APIBlueprint +from flask import Blueprint from .students import bp as students_bp -bp = APIBlueprint("coordinator", __name__, url_prefix="/coordinator") +bp = Blueprint("coordinator", __name__, url_prefix="/coordinator") bp.register_blueprint(students_bp) diff --git a/backend/app/factory.py b/backend/app/factory.py index a60bf5f..b4c2eee 100644 --- a/backend/app/factory.py +++ b/backend/app/factory.py @@ -1,9 +1,10 @@ -from factory import alchemy, Sequence, RelatedFactory, LazyAttribute +from factory import alchemy, Sequence from factory.faker import Faker from factory.fuzzy import FuzzyInteger, FuzzyChoice from .dependencies import db -from .students.models import Student, Group, ProjectSupervisor +from .students.models import Student, Group +from .project_supervisor.models import ProjectSupervisor class ProjectSupervisorFactory(alchemy.SQLAlchemyModelFactory): diff --git a/backend/app/project_supervisor/__init__.py b/backend/app/project_supervisor/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/project_supervisor/models.py b/backend/app/project_supervisor/models.py new file mode 100644 index 0000000..84e2e90 --- /dev/null +++ b/backend/app/project_supervisor/models.py @@ -0,0 +1,10 @@ +from ..dependencies import db +from ..base.models import Person, Base + + +class ProjectSupervisor(Base, Person): + __tablename__ = "project_supervisors" + + limit_group = db.Column(db.Integer, default=1, nullable=False) + count_groups = db.Column(db.Integer, default=1) + mode = db.Column(db.Boolean, default=True, nullable=False) # True - stationary, False - non-stationary diff --git a/backend/app/project_supervisor/routes/__init__.py b/backend/app/project_supervisor/routes/__init__.py new file mode 100644 index 0000000..57a4139 --- /dev/null +++ b/backend/app/project_supervisor/routes/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +from .groups import bp as bp_group + +bp = Blueprint("project_supervisor", __name__, url_prefix="/project_supervisor") + +bp.register_blueprint(bp_group) diff --git a/backend/app/project_supervisor/schemas.py b/backend/app/project_supervisor/schemas.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/backend/app/project_supervisor/schemas.py @@ -0,0 +1 @@ + diff --git a/backend/app/students/models.py b/backend/app/students/models.py index 1e2117c..b284052 100644 --- a/backend/app/students/models.py +++ b/backend/app/students/models.py @@ -6,14 +6,6 @@ from ..base.models import Person, Base from ..base.utils import order_by_column_name -class ProjectSupervisor(Base, Person): - __tablename__ = "project_supervisors" - - limit_group = db.Column(db.Integer, default=1, nullable=False) - count_groups = db.Column(db.Integer, default=1) - mode = db.Column(db.Boolean, default=True, nullable=False) # True - stationary, False - non-stationary - - class Group(Base): __tablename__ = "groups"