From: Jens Troeger Date: Sun, 10 Mar 2024 19:40:58 +0000 (-0700) Subject: add a docs cross-reference between adding columns & relationships to existing table... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11133%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a docs cross-reference between adding columns & relationships to existing table mappings --- 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