|
1 | 1 | from typing import List, Optional |
2 | 2 |
|
3 | 3 | from sqlalchemy import StaticPool |
4 | | - |
5 | 4 | from sqlmodel import Field, Relationship, Session, SQLModel, create_engine, select |
6 | 5 |
|
7 | 6 |
|
@@ -160,9 +159,7 @@ class Power(SQLModel, table=True): |
160 | 159 | team = Team(name="Marble", heroes=[hero_1, hero_2]) |
161 | 160 |
|
162 | 161 | engine = create_engine( |
163 | | - "sqlite://", |
164 | | - connect_args={"check_same_thread": False}, |
165 | | - poolclass=StaticPool |
| 162 | + "sqlite://", connect_args={"check_same_thread": False}, poolclass=StaticPool |
166 | 163 | ) |
167 | 164 |
|
168 | 165 | SQLModel.metadata.create_all(engine) |
@@ -231,9 +228,7 @@ class Power(SQLModel, table=True): |
231 | 228 | team = Team(name="Marble", heroes=[hero_1, hero_2]) |
232 | 229 |
|
233 | 230 | engine = create_engine( |
234 | | - "sqlite://", |
235 | | - connect_args={"check_same_thread": False}, |
236 | | - poolclass=StaticPool |
| 231 | + "sqlite://", connect_args={"check_same_thread": False}, poolclass=StaticPool |
237 | 232 | ) |
238 | 233 |
|
239 | 234 | SQLModel.metadata.create_all(engine) |
@@ -265,9 +260,7 @@ async def read_main(response_model=List[Team]): |
265 | 260 | "id": 1, |
266 | 261 | "team_id": 1, |
267 | 262 | "name": "Deadpond", |
268 | | - "powers": [ |
269 | | - {"id": 1, "hero_id": 1, "description": "Healing Power"} |
270 | | - ], |
| 263 | + "powers": [{"id": 1, "hero_id": 1, "description": "Healing Power"}], |
271 | 264 | }, |
272 | 265 | { |
273 | 266 | "id": 2, |
|
0 commit comments