From 9f9e0b87c074ad721cdc97222a7b6c32f8781a64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20Sampaio?= Date: Wed, 11 Aug 2021 11:36:49 -0300 Subject: [PATCH] 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. --- doc/build/orm/mapping_styles.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.2