]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
✏ Fix broken variable/typo in docs for Read Relationships, `hero_spider_boy.id` ...
authorYoann Mosteiro <41114561+yoannmos@users.noreply.github.com>
Sat, 27 Aug 2022 22:06:56 +0000 (00:06 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Aug 2022 22:06:56 +0000 (22:06 +0000)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs_src/tutorial/relationship_attributes/read_relationships/tutorial001.py
tests/test_tutorial/test_relationship_attributes/test_read_relationships/test_tutorial001.py

index 5f718cab45fa3dfca72eea8613089c9cd350bb5b..3b130072b7de3cc26bbb43b9729d6a784ea15118 100644 (file)
@@ -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)
index 887c98ee6fdaba90a5149a303985531e6d0761ec..9fc70012d8c0c638d48aa0af7e31b8c0b4c8f5b3 100644 (file)
@@ -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:",