From: João Sampaio Date: Wed, 11 Aug 2021 14:36:49 +0000 (-0300) Subject: Fix example with deprecated code X-Git-Tag: rel_1_4_23~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f9e0b87c074ad721cdc97222a7b6c32f8781a64;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix example with deprecated code Just a few lines above, it is said that creating a mapping with `mapper()` is deprecated in favor of `mapper_registry.map_imperatively()`. This PR fixes an example in the documentation that still uses the old function. --- diff --git a/doc/build/orm/mapping_styles.rst b/doc/build/orm/mapping_styles.rst index 09f01102bf..0f5d4f4719 100644 --- a/doc/build/orm/mapping_styles.rst +++ b/doc/build/orm/mapping_styles.rst @@ -571,11 +571,11 @@ object, mapped to a class called ``Address``, then linked to ``User`` via :func: Column('email_address', String(50)) ) - mapper(User, user, properties={ + mapper_registry.map_imperatively(User, user, properties={ 'addresses' : relationship(Address, backref='user', order_by=address.c.id) }) - mapper(Address, address) + mapper_registry.map_imperatively(Address, address) When using classical mappings, classes must be provided directly without the benefit of the "string lookup" system provided by Declarative. SQL expressions are typically