Skip to content

Commit 1bd5f27

Browse files
📝 Update documentation to refer to list instead of List (#1147)
Co-authored-by: Sofie Van Landeghem <[email protected]> Co-authored-by: svlandeg <[email protected]>
1 parent a82c3fe commit 1bd5f27

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/tutorial/code-structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ And this ends up *requiring* the same **circular imports** that are not supporte
183183

184184
But these **type annotations** we want to declare are not needed at *runtime*.
185185

186-
In fact, remember that we used `List["Hero"]`, with a `"Hero"` in a string?
186+
In fact, remember that we used `list["Hero"]`, with a `"Hero"` in a string?
187187

188188
For Python, at runtime, that is **just a string**.
189189

docs/tutorial/fastapi/response-model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For example, we can pass the same `Hero` **SQLModel** class (because it is also
3838

3939
We can also use other type annotations, the same way we can use with Pydantic fields. For example, we can pass a list of `Hero`s.
4040

41-
First, we import `List` from `typing` and then we declare the `response_model` with `List[Hero]`:
41+
To do so, we declare the `response_model` with `list[Hero]`:
4242

4343
{* ./docs_src/tutorial/fastapi/response_model/tutorial001_py310.py ln[40:44] hl[40] *}
4444

docs/tutorial/many-to-many/create-models-with-link.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Let's see the `Team` model, it's almost identical as before, but with a little c
2828

2929
{* ./docs_src/tutorial/many_to_many/tutorial001_py310.py ln[9:14] hl[14] *}
3030

31-
The **relationship attribute `heroes`** is still a list of heroes, annotated as `List["Hero"]`. Again, we use `"Hero"` in quotes because we haven't declared that class yet by this point in the code (but as you know, editors and **SQLModel** understand that).
31+
The **relationship attribute `heroes`** is still a list of heroes, annotated as `list["Hero"]`. Again, we use `"Hero"` in quotes because we haven't declared that class yet by this point in the code (but as you know, editors and **SQLModel** understand that).
3232

3333
We use the same **`Relationship()`** function.
3434

@@ -46,7 +46,7 @@ We **removed** the previous `team_id` field (column) because now the relationshi
4646

4747
The relationship attribute is now named **`teams`** instead of `team`, as now we support multiple teams.
4848

49-
It is no longer an `Optional[Team]` but a list of teams, annotated as **`List[Team]`**.
49+
It is no longer an `Optional[Team]` but a list of teams, annotated as **`list[Team]`**.
5050

5151
We are using the **`Relationship()`** here too.
5252

docs/tutorial/relationship-attributes/define-relationships-attributes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ And in the `Team` class, the `heroes` attribute is annotated as a list of `Hero`
8686

8787
/// tip
8888

89-
There's a couple of things we'll check again in some of the next chapters, about the `List["Hero"]` and the `back_populates`.
89+
There's a couple of things we'll check again in some of the next chapters, about the `list["Hero"]` and the `back_populates`.
9090

9191
But for now, let's first see how to use these relationship attributes.
9292

docs/tutorial/relationship-attributes/type-annotation-strings.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## About the String in `List["Hero"]`
1+
## About the String in `list["Hero"]`
22

3-
In the first Relationship attribute, we declare it with `List["Hero"]`, putting the `Hero` in quotes instead of just normally there:
3+
In the first Relationship attribute, we declare it with `list["Hero"]`, putting the `Hero` in quotes instead of just normally there:
44

55
{* ./docs_src/tutorial/relationship_attributes/define_relationship_attributes/tutorial001_py310.py ln[1:19] hl[9] *}
66

7-
What's that about? Can't we just write it normally as `List[Hero]`?
7+
What's that about? Can't we just write it normally as `list[Hero]`?
88

99
By that point, in that line in the code, the Python interpreter **doesn't know of any class `Hero`**, and if we put it just there, it would try to find it unsuccessfully, and then fail. 😭
1010

0 commit comments

Comments
 (0)