class WriteOnlyCollection(AbstractCollectionWriter[
Write-only collection which can synchronize changes into the attribute event system. The :class:`.WriteOnlyCollection` is used in a mapping by using the ``"write_only"`` lazy loading strategy with :func:`_orm.relationship`. For background on this configuration, see :ref:`write_only_relationship`. .. versionadded:: 2.0 .. seealso:: :ref:`write_only_relationship`
Method | __iter__ |
Undocumented |
Method | add |
Add an item to this :class:`_orm.WriteOnlyCollection`. |
Method | add |
Add an iterable of items to this :class:`_orm.WriteOnlyCollection`. |
Method | delete |
Produce a :class:`_dml.Delete` which will refer to rows in terms of this instance-local :class:`_orm.WriteOnlyCollection`. |
Method | insert |
For one-to-many collections, produce a :class:`_dml.Insert` which will insert new rows in terms of this this instance-local :class:`_orm.WriteOnlyCollection`. |
Method | remove |
Remove an item from this :class:`_orm.WriteOnlyCollection`. |
Method | select |
Produce a :class:`_sql.Select` construct that represents the rows within this instance-local :class:`_orm.WriteOnlyCollection`. |
Method | update |
Produce a :class:`_dml.Update` which will refer to rows in terms of this instance-local :class:`_orm.WriteOnlyCollection`. |
Class Variable | __slots__ |
Undocumented |
Inherited from AbstractCollectionWriter
:
Method | __init__ |
Undocumented |
Instance Variable | attr |
Undocumented |
Instance Variable | instance |
Undocumented |
Method | _add |
Undocumented |
Method | _remove |
Undocumented |
Instance Variable | _from |
Undocumented |
Instance Variable | _order |
Undocumented |
Instance Variable | _where |
Undocumented |
Add an item to this :class:`_orm.WriteOnlyCollection`. The given item will be persisted to the database in terms of the parent instance's collection on the next flush.
Add an iterable of items to this :class:`_orm.WriteOnlyCollection`. The given items will be persisted to the database in terms of the parent instance's collection on the next flush.
Produce a :class:`_dml.Delete` which will refer to rows in terms of this instance-local :class:`_orm.WriteOnlyCollection`.
For one-to-many collections, produce a :class:`_dml.Insert` which will insert new rows in terms of this this instance-local :class:`_orm.WriteOnlyCollection`. This construct is only supported for a :class:`_orm.Relationship` that does **not** include the :paramref:`_orm.relationship.secondary` parameter. For relationships that refer to a many-to-many table, use ordinary bulk insert techniques to produce new objects, then use :meth:`_orm.AbstractCollectionWriter.add_all` to associate them with the collection.
Remove an item from this :class:`_orm.WriteOnlyCollection`. The given item will be removed from the parent instance's collection on the next flush.
Produce a :class:`_sql.Select` construct that represents the rows within this instance-local :class:`_orm.WriteOnlyCollection`.
Produce a :class:`_dml.Update` which will refer to rows in terms of this instance-local :class:`_orm.WriteOnlyCollection`.