move models in seperate modules

This commit is contained in:
Patrick Jentsch
2024-03-05 16:02:23 +01:00
parent cf8c164d60
commit a1e5bd61e0
20 changed files with 1890 additions and 2 deletions

View File

@ -22,8 +22,6 @@ db = SQLAlchemy()
docker_client = DockerClient()
hashids = Hashids()
login = LoginManager()
login.login_view = 'auth.login'
login.login_message = 'Please log in to access this page.'
ma = Marshmallow()
mail = Mail()
migrate = Migrate(compare_type=True)
@ -104,4 +102,11 @@ def create_app(config: Config = Config) -> Flask:
from .workshops import bp as workshops_blueprint
app.register_blueprint(workshops_blueprint, url_prefix='/workshops')
login.login_view = 'auth.login'
login.login_message = 'Please log in to access this page.'
from .models.user import User
@login.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
return app