code-review-fix task 15.2: replace declarative_base() with class Base(DeclarativeBase) in db.py
This commit is contained in:
parent
728c7e4d82
commit
a03c9bc17b
1 changed files with 3 additions and 3 deletions
|
|
@ -10,8 +10,7 @@ from contextlib import contextmanager
|
|||
from typing import Generator
|
||||
|
||||
from sqlalchemy import create_engine, Column, Integer, String, DateTime, JSON
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker, Session
|
||||
from sqlalchemy.orm import DeclarativeBase, sessionmaker, Session
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
|
||||
|
|
@ -35,7 +34,8 @@ engine = create_engine(
|
|||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
# Base class for declarative models
|
||||
Base = declarative_base()
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
|
||||
|
||||
# Training runs model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue