From: Yoann Mosteiro <41114561+yoannmos@users.noreply.github.com> Date: Sat, 27 Aug 2022 22:06:56 +0000 (+0200) Subject: ✏ Fix broken variable/typo in docs for Read Relationships, `hero_spider_boy.id` ... X-Git-Tag: 0.0.7~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee576ab279b88cedef3e241203b112080c9d7066;p=thirdparty%2Ffastapi%2Fsqlmodel.git ✏ Fix broken variable/typo in docs for Read Relationships, `hero_spider_boy.id` => `hero_spider_boy.team_id` (#106) Co-authored-by: Sebastián Ramírez --- diff --git a/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py b/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py index 5f718cab..3b130072 100644 --- a/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py +++ b/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py @@ -99,7 +99,7 @@ def select_heroes(): result = session.exec(statement) hero_spider_boy = result.one() - statement = select(Team).where(Team.id == hero_spider_boy.id) + statement = select(Team).where(Team.id == hero_spider_boy.team_id) result = session.exec(statement) team = result.first() print("Spider-Boy's team:", team) diff --git a/tests/test_tutorial/test_relationship_attributes/test_read_relationships/test_tutorial001.py b/tests/test_tutorial/test_relationship_attributes/test_read_relationships/test_tutorial001.py index 887c98ee..9fc70012 100644 --- a/tests/test_tutorial/test_relationship_attributes/test_read_relationships/test_tutorial001.py +++ b/tests/test_tutorial/test_relationship_attributes/test_read_relationships/test_tutorial001.py @@ -81,7 +81,7 @@ expected_calls = [ ], [ "Spider-Boy's team:", - {"headquarters": "Wakaland Capital City", "id": 3, "name": "Wakaland"}, + {"headquarters": "Sharp Tower", "id": 2, "name": "Preventers"}, ], [ "Spider-Boy's team again:",