class CollectionAdapter(object):
Bridges between the ORM and arbitrary Python collections.
Proxies base-level collection operations (append, remove, iterate) to the underlying Python collection, and emits add/remove events for entities entering or leaving the collection.
The ORM uses .CollectionAdapter
exclusively for interaction with
entity collections.
Method | __bool__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Iterate over entities in the collection. |
Method | __len__ |
Count entities in the collection. |
Method | __setstate__ |
Undocumented |
Method | _refuse_empty |
Undocumented |
Method | _reset_empty |
Undocumented |
Method | _set_empty |
Undocumented |
Method | _warn_invalidated |
Undocumented |
Method | append_multiple_without_event |
Add or restore an entity to the collection, firing no events. |
Method | append_with_event |
Add an entity to the collection, firing mutation events. |
Method | append_without_event |
Add or restore an entity to the collection, firing no events. |
Method | bulk_appender |
Undocumented |
Method | bulk_remover |
Undocumented |
Method | clear_with_event |
Empty the collection, firing a mutation event for each entity. |
Method | clear_without_event |
Empty the collection, firing no events. |
Method | fire_append_event |
Notify that a entity has entered the collection. |
Method | fire_append_wo_mutation_event |
Notify that a entity is entering the collection but is already present. |
Method | fire_pre_remove_event |
Notify that an entity is about to be removed from the collection. |
Method | fire_remove_event |
Notify that a entity has been removed from the collection. |
Method | remove_with_event |
Remove an entity from the collection, firing mutation events. |
Method | remove_without_event |
Remove an entity from the collection, firing no events. |
Class Variable | __slots__ |
Undocumented |
Instance Variable | _converter |
Undocumented |
Instance Variable | _data |
Undocumented |
Instance Variable | _key |
Undocumented |
Instance Variable | attr |
Undocumented |
Instance Variable | empty |
Undocumented |
Instance Variable | invalidated |
Undocumented |
Instance Variable | owner_state |
Undocumented |
Property | _referenced_by_owner |
return True if the owner state still refers to this collection. |
Property | data |
The entity collection being adapted. |
Notify that a entity has entered the collection.
Initiator is a token owned by the InstrumentedAttribute that initiated the membership mutation, and should be left as None unless you are passing along an initiator value from a chained operation.
Notify that a entity is entering the collection but is already present.
Initiator is a token owned by the InstrumentedAttribute that initiated the membership mutation, and should be left as None unless you are passing along an initiator value from a chained operation.
Notify that an entity is about to be removed from the collection.
Only called if the entity cannot be removed after calling fire_remove_event().
Notify that a entity has been removed from the collection.
Initiator is the InstrumentedAttribute that initiated the membership mutation, and should be left as None unless you are passing along an initiator value from a chained operation.