20 lines
617 B
Python
20 lines
617 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
|
|
from .view_setting import ViewSetting as ViewSetting
|
|
|
|
|
|
class UserBase(BotEntity, table = False):
|
|
|
|
__tablename__ = "user"
|
|
|
|
lang: LanguageBase = Field(sa_type = EnumType(LanguageBase), default = LanguageBase.EN)
|
|
is_active: bool = True
|
|
|
|
roles: list[RoleBase] = Field(sa_type=ARRAY(EnumType(RoleBase)), default = [RoleBase.DEFAULT_USER]) |