19 lines
569 B
Python
19 lines
569 B
Python
from sqlmodel import Field, ARRAY
|
|
|
|
from .bot_entity import BotEntity
|
|
from .bot_enum import EnumType
|
|
from .language import LanguageBase
|
|
from .role import RoleBase
|
|
|
|
from .settings import DbSettings as DbSettings
|
|
from .fsm_storage import FSMStorage as FSMStorage
|
|
|
|
|
|
class UserBase(BotEntity, table = False):
|
|
|
|
__tablename__ = "user"
|
|
|
|
lang: LanguageBase = Field(sa_type = EnumType(LanguageBase), default = LanguageBase.DEFAULT)
|
|
is_active: bool = True
|
|
|
|
roles: list[RoleBase] = Field(sa_type=ARRAY(EnumType(RoleBase)), default = [RoleBase.DEFAULT_USER]) |