Entity Types (🧪Beta)
albert.resources.entity_types
EntityCategory
Categories that an entity type should be based on.
Attributes:
| Name | Type | Description |
|---|---|---|
PROPERTY |
str
|
Property category. |
BATCH |
str
|
Batch category. |
GENERAL |
str
|
General category. |
RAW_MATERIALS |
str
|
Raw materials category. |
CONSUMABLES |
str
|
Consumables category. |
EQUIPMENT |
str
|
Equipment category. |
FORMULAS |
str
|
Formulas category. |
EntityServiceType
Types of services that an entity type can be associated with.
Attributes:
| Name | Type | Description |
|---|---|---|
TASKS |
str
|
Tasks service type. |
PARAMETER_GROUPS |
str
|
Parameter Groups service type. |
DATA_TEMPLATES |
str
|
Data Templates service type. |
PROJECTS |
str
|
Projects service type. |
LOTS |
str
|
Lots service type. |
INVENTORIES |
str
|
Inventories service type. |
EntityTypeType
FieldSection
EntityCustomField
Bases: BaseAlbertModel
Custom fields associated with an entity type.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
CustomFieldId
|
The ID of the custom field. |
name |
str | None
|
Read-only name of the custom field. |
section |
FieldSection
|
The section where the field should be displayed (i.e., top or bottom). |
hidden |
bool
|
Whether the field should be hidden. |
default |
(str | float | EntityLink | None, optional)
|
The default value for the field. |
EntityTypeStandardFieldVisibility
EntityTypeStandardFieldRequired
EntityTypeSearchQueryStrings
Bases: BaseAlbertModel
Search query strings for different entity type views. These strings define how to construct search queries for different selectable entities within the entity type. They can include placeholders for custom fields that will be replaced with actual values.
Attributes:
| Name | Type | Description |
|---|---|---|
DAT |
(str | None, optional)
|
Search query string for the data view. |
PRG |
(str | None, optional)
|
Search query string for the program view. |
Examples:
EntityType
Bases: BaseResource
An entity type in the Albert system. Entity types define the structure and behavior of entities in the system. They can be custom or system types, and can have associated custom fields and rules.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
EntityTypeId
|
The unique identifier for the entity type. |
category |
EntityCategory
|
The category the entity type belongs to. |
custom_category |
(str | None, optional)
|
A custom category name for the entity type. |
label |
str
|
The display label for the entity type. |
service |
EntityServiceType
|
The service type associated with this entity type. |
type |
EntityTypeType
|
The type of entity type (custom or system). |
prefix |
(str | None, optional)
|
The prefix used for IDs of this entity type. |
standard_field_visibility |
EntityTypeStandardFieldVisibility
|
Visibility settings for standard fields. |
template_based |
(bool | None, optional)
|
Whether this entity type is template-based. If True, users can only instantiate this entity type from a template. |
locked_template |
(bool | None, optional)
|
Whether the template is locked. If True, users cannot edit the template. |
custom_category
custom_category: str | None = Field(
default=None,
max_length=100,
min_length=1,
alias="customCategory",
)
custom_fields
custom_fields: list[EntityCustomField] | None = Field(
default=None, alias="customFields"
)
standard_field_visibility
standard_field_visibility: (
EntityTypeStandardFieldVisibility | None
) = Field(alias="standardFieldVisibility", default=None)
standard_field_required
standard_field_required: (
EntityTypeStandardFieldRequired | None
) = Field(alias="standardFieldRequired", default=None)
search_query_string
search_query_string: EntityTypeSearchQueryStrings | None = (
Field(alias="searchQueryString", default=None)
)
EntityTypeOptionType
EntityLinkOption
EntityTypeFieldOptions
EntityTypeFieldOptions(**data: Any)
Bases: BaseAlbertModel
Options for a field in an entity type.
Attributes:
| Name | Type | Description |
|---|---|---|
option_type |
EntityTypeOptionType
|
The type of option (string or list). |
values |
(list[str | EntityLink] | None, optional)
|
The possible values for this option. |
Source code in src/albert/resources/entity_types.py
EntityTypeRuleAction
EntityTypeRuleAction(**data: Any)
Bases: BaseAlbertModel
An action that can be taken when a rule is triggered.
Attributes:
| Name | Type | Description |
|---|---|---|
target_field |
str
|
The name of the field that this action affects. |
hidden |
(bool | None, optional)
|
Whether the field should be hidden. |
required |
(bool | None, optional)
|
Whether the field should be required. |
default |
(str | float | EntityLink | None, optional)
|
The default value for the field. |
options |
(EntityTypeFieldOptions | None, optional)
|
Available options for the field. |
Source code in src/albert/resources/entity_types.py
EntityTypeRuleTriggerCase
Bases: BaseAlbertModel
A case in a rule that defines when actions should be taken.
Attributes:
| Name | Type | Description |
|---|---|---|
value |
str
|
The value of the triggering field that triggers this case. |
actions |
list[EntityTypeRuleAction]
|
The actions to take when this case is triggered. |
EntityTypeRuleTrigger
Bases: BaseAlbertModel
A trigger that can activate rule cases.
Attributes:
| Name | Type | Description |
|---|---|---|
cases |
list[EntityTypeRuleTriggerCase]
|
The cases that should be evaluated when this trigger is activated. |
EntityTypeRule
Bases: BaseResource
A rule that defines conditional behavior for entity type fields.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
RuleId
|
The unique identifier for the rule. |
custom_field_id |
CustomFieldId
|
The ID of the custom field this rule listens to/ triggers on. |
trigger |
EntityTypeRuleTrigger
|
The triggers that activate this rule. |