From 4146732526a264ea33dc3b46640c5c4ebb872c2c Mon Sep 17 00:00:00 2001 From: Yoann Mosteiro <41114561+yoannmos@users.noreply.github.com> Date: Mon, 20 Sep 2021 16:46:38 +0200 Subject: [PATCH 1/2] :book: Fix id => team_id Correcting the statement that select the team where Team.id == team.id of hero_spider_boy (1) not the hero.id (3 in this case) --- .../relationship_attributes/read_relationships/tutorial001.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py b/docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py index e5c23a7264..5d587bb946 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) From 3455b2905f09fbf33ef78758a1fa161016f34364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 28 Aug 2022 00:05:45 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=85=20Fix=20test=20after=20fixing=20e?= =?UTF-8?q?xample=20in=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test_read_relationships/test_tutorial001.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 887c98ee6f..9fc70012d8 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 @@ ], [ "Spider-Boy's team:", - {"headquarters": "Wakaland Capital City", "id": 3, "name": "Wakaland"}, + {"headquarters": "Sharp Tower", "id": 2, "name": "Preventers"}, ], [ "Spider-Boy's team again:",