Replace db.Model with DeclarativeBase from SQLAlchemy for Flask-SQLAlchemy-Lite migration

This commit is contained in:
2026-04-06 01:49:44 +08:00
parent e6d25882fc
commit 9c6cc1f3eb
8 changed files with 49 additions and 24 deletions
+2 -2
View File
@@ -24,13 +24,13 @@ from flask import Blueprint, render_template, Flask, redirect, url_for, \
session, request, g, Response, abort
from sqlalchemy.orm import Mapped, mapped_column
from . import db
from . import db, Base
bp: Blueprint = Blueprint("auth", __name__, url_prefix="/")
"""The authentication blueprint."""
class User(db.Model):
class User(Base):
"""A user."""
__tablename__ = "users"
"""The table name."""