project structure and database

This commit is contained in:
2025-07-27 19:34:40 +04:00
parent 833bcd6ff7
commit 361f94323c
23 changed files with 474 additions and 11 deletions

12
models/base.py Normal file
View File

@ -0,0 +1,12 @@
from sqlalchemy.ext.asyncio import AsyncAttrs
from sqlalchemy.orm import DeclarativeBase
class BaseModel(DeclarativeBase, AsyncAttrs):
def __repr__(self):
if hasattr(self, 'id'):
return f'<{self.__class__.__name__} id={self.id}>'
return super().__repr__()
metadata = BaseModel.metadata