2023-01-03 07:54:57 +00:00
|
|
|
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
|
|
|
|
|
2023-01-03 05:52:59 +00:00
|
|
|
|
|
|
|
class CustomEmoji(SQLModel, table=True):
|
2023-01-03 07:54:57 +00:00
|
|
|
id: Optional[int] = Field(primary_key=True, default=None)
|
|
|
|
shortcode: str
|
2023-01-03 05:52:59 +00:00
|
|
|
url: str
|
|
|
|
static_url: str
|
|
|
|
visible_in_picker: bool
|
2023-01-03 07:54:57 +00:00
|
|
|
category: str
|
|
|
|
|
|
|
|
accounts: List['Account'] = Relationship(back_populates='emojis', link_model=EmojiAccountLink)
|
|
|
|
statuses: List['Status'] = Relationship(back_populates='emojis', link_model=EmojiStatusLink)
|