- Added flake8

- create_user moved to commands
This commit is contained in:
2023-09-16 18:06:47 +04:00
parent 3659e04622
commit f782944caa
29 changed files with 239 additions and 132 deletions

View File

@@ -1 +1 @@
from app.db.base_class import Base
from app.db.base_class import Base

View File

@@ -16,10 +16,14 @@ class Base:
__name__: str
id: Any
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
created_at = Column(
DateTime(timezone=True),
server_default=func.now(),
nullable=False
)
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
# Generate __tablename__ automatically
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()
return cls.__name__.lower()

View File

@@ -34,4 +34,4 @@ AsyncSessionLocal: AsyncSession = sessionmaker(
autoflush=False,
bind=async_engine,
class_=AsyncSession
)
)