fix: default values in subordinate entities based on static_filtering, add: button visibility callbacks in entities' forms

This commit is contained in:
Alexander Kalinovsky
2025-01-22 20:04:32 +01:00
parent 9dd0708a5b
commit b40e588379
7 changed files with 129 additions and 77 deletions

View File

@@ -24,6 +24,7 @@ EntityFieldCaptionCallable = Callable[["EntityFieldDescriptor", Any, Any], str]
@dataclass
class FieldEditButton:
field_name: str
visibility: Callable[[Any], bool] | None = None
caption: str | LazyProxy | EntityFieldCaptionCallable | None = None
@@ -31,7 +32,8 @@ class FieldEditButton:
class CommandButton:
command: str
caption: str | LazyProxy | EntityItemCaptionCallable | None = None
context_data: ContextData | None = None
visibility: Callable[[Any], bool] | None = None
context_data: ContextData | Callable[[ContextData, Any], ContextData] | None = None
@dataclass
@@ -64,7 +66,7 @@ class EntityList:
item_form: str | None = None
pagination: bool = True
static_filters: list[Filter] | Any = None
filtering: bool = True
filtering: bool = False
filtering_fields: list[str] = None
order_by: str | Any | None = None