betty.entity.collection package

Submodules

Module contents

Entity collections.

class betty.entity.collection.EntityCollection

Bases: ABC, Generic

Provide a collection of entities.

To test your own subclasses, use betty.test_utils.entity.collection.EntityCollectionTestBase.

abstractmethod add(*entities: TargetT) None

Add the given entities.

abstractmethod clear() None

Clear all entities from the collection.

abstractmethod remove(*entities: TargetT) None

Remove the given entities.

replace(*entities: TargetT) None

Replace all entities with the given ones.

property view: Sequence[TargetT]

A view of the entities at the time of calling.