betty.model.collections module¶
Entity collections.
- class betty.model.collections.EntityCollection[source]¶
Bases:
Mutable,Generic[_TargetT],ABCProvide a collection of entities.
To test your own subclasses, use
betty.test_utils.model.collections.EntityCollectionTestBase.- get_mutable_instances() Iterable[Mutable][source]¶
Get any other
betty.mutability.Mutableinstances contained by this one.
- property view: Sequence[_TargetT & Entity]¶
A view of the entities at the time of calling.
- class betty.model.collections.MultipleTypesEntityCollection[source]¶
Bases:
Generic[_TargetT],EntityCollection[_TargetT]Collect entities of multiple types.
- __init__(*entities: _TargetT & Entity, entity_type_id_to_type_mapping: PluginIdToTypeMapping[Entity])[source]¶
- class betty.model.collections.SingleTypeEntityCollection[source]¶
Bases:
Generic[_TargetT],EntityCollection[_TargetT]Collect entities of a single type.
- betty.model.collections.record_added(entities: EntityCollection[_EntityT]) AsyncIterator[MultipleTypesEntityCollection[_EntityT]][source]¶
Record all entities that are added to a collection.