Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

EntityNavigatorView

Navigator over views. Edges: view -> notes embedding it; upstream is the view's resource.

Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

entities : Union
delete_propagated_tags

Inverse of propagate_tags for view edges: remove VIEW_PROPAGATED copies from notes embedding the wrapped views.

tags : list
entity_tags_cache : dict[gws_core.entity_navigator.entity_navigator_type.NavigableEntity, gws_core.tag.entity_tag_list.EntityTagList] | None
visited : set[gws_core.entity_navigator.entity_navigator_type.NavigableEntity] | None
get_as_nav_set

Wrap the current entities as a depth-0 NavigableEntitySet.

Return type : NavigableEntitySet
get_entities_as_set

Return the wrapped entities as a set.

Return type : set
get_entities_list

Return the wrapped entities as a list. Order is not guaranteed (the underlying storage is a set).

Return type : list
get_first_entity

Return an arbitrary entity from the set, or None if empty.

Useful when the caller knows the navigator wraps a single entity.

Return type : Optional
get_next_entities

Return the direct downstream neighbors of the wrapped entities.

Only one hop is followed (no recursion). Entities of any type listed in requested_entities are merged into a single NavigableEntitySet.

requested_entities : list
Return type : NavigableEntitySet
get_next_entities_recursive

Return every entity transitively reachable downstream.

Traverses the lineage graph breadth-first. Each entity is visited once, annotated with its depth in the returned NavigableEntitySet. Use this for impact analysis ("what entities would be affected"). Edge-level provenance is not preserved -- if you need to know which immediate upstream caused a given downstream to be reached, use propagate_tags instead.

requested_entities : list[gws_core.entity_navigator.entity_navigator_type.NavigableEntityType] | None
entity types to consider during traversal. Defaults to all four navigable types.
include_current_entities : bool - False
Return type : NavigableEntitySet
get_next_notes

Return notes that embed any of the wrapped views via NoteViewModel.

Return type : EntityNavigatorNote
get_next_resources

Return the direct downstream resources. Empty by default; overridden by subclasses.

Return type : EntityNavigatorResource
get_next_scenarios

Return the direct downstream scenarios. Empty by default; overridden by subclasses.

Return type : EntityNavigatorScenario
get_next_views

Return the direct downstream views. Empty by default; overridden by subclasses.

Return type : EntityNavigatorView
get_previous_entities_recursive

Return every entity transitively reachable upstream.

Mirror of get_next_entities_recursive but walks the lineage graph in the opposite direction (towards ancestors).

requested_entities : list[gws_core.entity_navigator.entity_navigator_type.NavigableEntityType] | None
entity types to consider during traversal. Defaults to all four navigable types.
include_current_entities : bool - False
Return type : NavigableEntitySet
get_previous_notes

Return the direct upstream notes. Empty by default; overridden by subclasses.

Return type : EntityNavigatorNote
get_previous_resources

Return the resources that the wrapped views are configured against.

Return type : EntityNavigatorResource
get_previous_scenarios

Return the scenarios that produced the resources of the wrapped views.

Return type : EntityNavigatorScenario
get_previous_views

Return the direct upstream views. Empty by default; overridden by subclasses.

Return type : EntityNavigatorView
has_entities

Return True if at least one entity is wrapped.

Return type : bool
has_next_entities

Return True if any direct downstream neighbor exists.

requested_entities : list[gws_core.entity_navigator.entity_navigator_type.NavigableEntityType] | None
Return type : bool
is_empty

Return True if no entities are wrapped.

Return type : bool
propagate_tags

Propagate tags from each wrapped view to the notes embedding it, then recurse. Origin is VIEW_PROPAGATED carrying the upstream view's id. See EntityNavigator.propagate_tags for the cache/visited contract.

tags : list
entity_tags_cache : dict[gws_core.entity_navigator.entity_navigator_type.NavigableEntity, gws_core.tag.entity_tag_list.EntityTagList] | None
visited : set[gws_core.entity_navigator.entity_navigator_type.NavigableEntity] | None
from_entity_id @classmethod

Build the appropriate concrete navigator for a single entity, by type and id.

Raises if the entity does not exist or if entity_type is unknown.

entity_type : NavigableEntityType
entity_id : str
Return type : EntityNavigator
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.