14 lines
421 B
Python
14 lines
421 B
Python
from typing import Optional, List, TYPE_CHECKING
|
|
from sqlmodel import Field, SQLModel, Relationship
|
|
|
|
from diyalgo.models.links import TagStatusLink
|
|
|
|
if TYPE_CHECKING:
|
|
from diyalgo.models import Status
|
|
|
|
class Tag(SQLModel, table=True):
|
|
id: Optional[int] = Field(primary_key=True, default=None)
|
|
name: str
|
|
url: str
|
|
|
|
statuses: List['Status'] = Relationship(back_populates='tags', link_model=TagStatusLink) |