class WriteOnlyMapped(_MappedAnnotationBase[
Known subclasses: sqlalchemy.orm.relationships.Relationship
Represent the ORM mapped attribute type for a "write only" relationship. The :class:`_orm.WriteOnlyMapped` type annotation may be used in an :ref:`Annotated Declarative Table <orm_declarative_mapped_column>` mapping to indicate that the ``lazy="write_only"`` loader strategy should be used for a particular :func:`_orm.relationship`. E.g.:: class User(Base): __tablename__ = "user" id: Mapped[int] = mapped_column(primary_key=True) addresses: WriteOnlyMapped[Address] = relationship( cascade="all,delete-orphan" ) See the section :ref:`write_only_relationship` for background. .. versionadded:: 2.0 .. seealso:: :ref:`write_only_relationship` - complete background :class:`.DynamicMapped` - includes legacy :class:`_orm.Query` support
Method | __get__ |
Undocumented |
Method | __set__ |
Undocumented |
Class Variable | __slots__ |
Undocumented |
Inherited from TypingOnly
(via _MappedAnnotationBase
):
Method | __init |
Undocumented |