]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add missing query before trying to print (#7665)
authorMike Knudson <mtgeekman@gmail.com>
Wed, 23 Feb 2022 20:51:50 +0000 (13:51 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Feb 2022 20:51:50 +0000 (21:51 +0100)
The documentation had a print before a query was run.

lib/sqlalchemy/ext/automap.py

index eb746dcee7e8e29e708b0ad56553b8dca008ec33..e0f532152f049941c23edc3f8751b666ecd68277 100644 (file)
@@ -56,6 +56,7 @@ asking it to reflect the schema and produce mappings::
 
     # collection-based relationships are by default named
     # "<classname>_collection"
+    u1 = session.query(User).first()
     print (u1.address_collection)
 
 Above, calling :meth:`.AutomapBase.prepare` while passing along the