project structure and database
This commit is contained in:
0
models/__init__.py
Normal file
0
models/__init__.py
Normal file
12
models/base.py
Normal file
12
models/base.py
Normal 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
|
||||
Reference in New Issue
Block a user