Replace db.Model with DeclarativeBase from SQLAlchemy for Flask-SQLAlchemy-Lite migration
This commit is contained in:
@@ -13,7 +13,7 @@ The following is an example configuration for *Mia! Accounting*.
|
||||
|
||||
from flask import Response, redirect
|
||||
from .auth import current_user()
|
||||
from .modules import User
|
||||
from .modules import Base, User
|
||||
|
||||
def create_app(test_config=None) -> Flask:
|
||||
app: Flask = Flask(__name__)
|
||||
@@ -36,6 +36,10 @@ The following is an example configuration for *Mia! Accounting*.
|
||||
def unauthorized(self) -> Response:
|
||||
return redirect("/login")
|
||||
|
||||
@property
|
||||
def base(self) -> type[DeclarativeBase]:
|
||||
return Base
|
||||
|
||||
@property
|
||||
def cls(self) -> type[User]:
|
||||
return User
|
||||
|
||||
Reference in New Issue
Block a user