API Reference - Results¶
Event Results¶
EventResult¶
- class EventResult¶
Represents the result of an event execution with metadata.
Attributes:
- Parameters:
error – Whether the execution resulted in an error
event_name – Name of the event that produced this result
content – Result content/data
task_id – Unique identifier for the task
init_params – Event initialization parameters
call_params – Event call parameters
process_id – ID of the process that executed the event
creation_time – Timestamp of result creation
Methods:
- get_state() Dict[str, Any]¶
Get the serializable state of the result.
- set_state(state: Dict[str, Any])¶
Restore the result state from a dictionary.
- is_error() bool¶
Check if the result represents an error.
- as_dict() dict¶
Convert the result to a dictionary.
Result Collections¶
ResultSet¶
- class ResultSet¶
A collection of Result objects with advanced filtering and query capabilities. Implements MutableSet interface for collection operations.
Methods:
- clear()¶
Remove all results.
- get(**filters) Result¶
Get a single result matching the filters. Raises MultiValueError if more than one match found.
- Raises:
KeyError if no match found
- Raises:
MultiValueError if multiple matches found
- filter(**filter_params) ResultSet¶
Filter results by attribute values with support for nested fields.
Features:
Basic attribute matching (user=x)
Nested dictionary lookups (profile__name=y)
List/iterable searching (tags__contains=z)
Special Operators:
__contains: Check if value is in a list/iterable
__startswith: String starts with value
__endswith: String ends with value
__icontains: Case-insensitive contains
__gt, __gte, __lt, __lte: Comparisons
__in: Check if field value is in provided list
__exact: Exact matching (default behavior)
__isnull: Check if field is None
Examples:
rs.filter(name="Alice") # Basic field matching rs.filter(user__profile__city="New York") # Nested lookup rs.filter(tags__contains="urgent") # Check if list contains value rs.filter(name__startswith="A") # String prefix matching
- first() Result | None¶
Return the first result or None if empty.
Entity Types¶
EntityContentType¶
- class EntityContentType¶
Represents the content type information for an entity.
Attributes:
- Parameters:
backend_import_str – Import string for the backend
entity_content_type – Content type identifier
Methods:
- classmethod add_entity_content_type(record: Result) EntityContentType | None¶
Create and register a content type for a result record.