fix: filtering capabilities, feat: improve enum i18n
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from aiogram.utils.i18n import I18n
|
||||
from pydantic_core.core_schema import str_schema
|
||||
from sqlalchemy.types import TypeDecorator, String
|
||||
from typing import Any, Self, overload
|
||||
@@ -133,7 +134,11 @@ class EnumMember(object):
|
||||
if lang and lang in self.loc_obj.keys():
|
||||
return self.loc_obj[lang]
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
i18n = I18n.get_current()
|
||||
if i18n:
|
||||
return self.loc_obj[i18n.current_locale]
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
|
||||
return self.value
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class EntityList:
|
||||
show_add_new_button: bool = True
|
||||
item_form: str | None = None
|
||||
pagination: bool = True
|
||||
static_filters: list[Filter] | Any = None
|
||||
static_filters: list[Filter] = None
|
||||
filtering: bool = False
|
||||
filtering_fields: list[str] = None
|
||||
order_by: str | Any | None = None
|
||||
|
||||
Reference in New Issue
Block a user