19 lines
633 B
Python
19 lines
633 B
Python
from typing import Optional, List, TYPE_CHECKING
|
|
from sqlmodel import Field, SQLModel, Relationship
|
|
|
|
from diyalgo.models.links import EmojiAccountLink, EmojiStatusLink
|
|
|
|
if TYPE_CHECKING:
|
|
from diyalgo.models import Account, Status
|
|
|
|
|
|
class CustomEmoji(SQLModel, table=True):
|
|
id: Optional[int] = Field(primary_key=True, default=None)
|
|
shortcode: str
|
|
url: str
|
|
static_url: str
|
|
visible_in_picker: bool
|
|
category: str
|
|
|
|
accounts: List['Account'] = Relationship(back_populates='emojis', link_model=EmojiAccountLink)
|
|
statuses: List['Status'] = Relationship(back_populates='emojis', link_model=EmojiStatusLink) |