Stop using SQLAlchemy ORM everywhere

This commit is contained in:
Tulir Asokan
2019-02-14 00:06:45 +02:00
parent 8ef82abe9d
commit 9174186442
5 changed files with 29 additions and 25 deletions
+2 -3
View File
@@ -25,10 +25,9 @@ from .user import User, UserPortal, Contact
from .user_profile import UserProfile
def init(db_session, db_engine) -> None:
BotChat.query = db_session.query_property()
def init(db_engine) -> None:
for table in (Portal, Message, User, Contact, UserPortal, Puppet, TelegramFile, UserProfile,
RoomState):
RoomState, BotChat):
table.db = db_engine
table.t = table.__table__
table.c = table.t.c