init project_supervisor app

This commit is contained in:
dominik24c 2022-06-10 17:53:32 +02:00
parent 382bea2a21
commit 2a846d4394
8 changed files with 25 additions and 12 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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):

View File

@ -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

View File

@ -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)

View File

@ -0,0 +1 @@

View File

@ -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"