Implement BaseModel class, TimestampMixin, TzDateTime type; cleanup Task model
This commit is contained in:
parent
7ce43a2bfe
commit
252c15acbd
15 changed files with 223 additions and 42 deletions
14
tofu_api/common/database/typing.py
Normal file
14
tofu_api/common/database/typing.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from typing import TypeVar, Union
|
||||
|
||||
from sqlalchemy import Column
|
||||
from sqlalchemy.orm import RelationshipProperty
|
||||
|
||||
__all__ = [
|
||||
'Col',
|
||||
'Rel',
|
||||
]
|
||||
|
||||
# Define type aliases for SQLAlchemy columns and relationships in declarative models
|
||||
_T = TypeVar('_T')
|
||||
Col = Union[Column, _T]
|
||||
Rel = Union[RelationshipProperty, _T]
|
||||
Loading…
Add table
Add a link
Reference in a new issue