From f8cc7a9c510f058f75bcb4308f3f398b8ae70de8 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Sun, 10 Mar 2024 12:40:58 -0700 Subject: [PATCH] add a docs cross-reference between adding columns & relationships to existing table mappings --- doc/build/orm/basic_relationships.rst | 4 +++- doc/build/orm/declarative_tables.rst | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/build/orm/basic_relationships.rst b/doc/build/orm/basic_relationships.rst index 0860f69fcf..a1bdb0525c 100644 --- a/doc/build/orm/basic_relationships.rst +++ b/doc/build/orm/basic_relationships.rst @@ -1102,8 +1102,10 @@ that will be passed to ``eval()`` are: are **evaluated as Python code expressions using eval(). DO NOT PASS UNTRUSTED INPUT TO THESE ARGUMENTS.** +.. _orm_declarative_table_adding_relationship: + Adding Relationships to Mapped Classes After Declaration -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It should also be noted that in a similar way as described at :ref:`orm_declarative_table_adding_columns`, any :class:`_orm.MapperProperty` diff --git a/doc/build/orm/declarative_tables.rst b/doc/build/orm/declarative_tables.rst index 4a1cbd0da3..12d7e16b96 100644 --- a/doc/build/orm/declarative_tables.rst +++ b/doc/build/orm/declarative_tables.rst @@ -1158,6 +1158,10 @@ additional columns are present on mapped subclasses that have no :class:`.Table` of their own. This is illustrated in the section :ref:`single_inheritance`. +Note that in a similar fashion a :func:`_orm.relationship` can be added +to an existing declarative table mapping as described in +:ref:`orm_declarative_table_adding_relationship`. + .. note:: Assignment of mapped properties to an already mapped class will only function correctly if the "declarative base" class is used, meaning -- 2.47.2