mirror of
https://github.com/fastapi/sqlmodel.git
synced 2026-03-13 09:29:54 +08:00
📝 Update documentation to refer to list instead of List (#1147)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> Co-authored-by: svlandeg <svlandeg@github.com>
This commit is contained in:
@@ -86,7 +86,7 @@ And in the `Team` class, the `heroes` attribute is annotated as a list of `Hero`
|
||||
|
||||
/// tip
|
||||
|
||||
There's a couple of things we'll check again in some of the next chapters, about the `List["Hero"]` and the `back_populates`.
|
||||
There's a couple of things we'll check again in some of the next chapters, about the `list["Hero"]` and the `back_populates`.
|
||||
|
||||
But for now, let's first see how to use these relationship attributes.
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## About the String in `List["Hero"]`
|
||||
## About the String in `list["Hero"]`
|
||||
|
||||
In the first Relationship attribute, we declare it with `List["Hero"]`, putting the `Hero` in quotes instead of just normally there:
|
||||
In the first Relationship attribute, we declare it with `list["Hero"]`, putting the `Hero` in quotes instead of just normally there:
|
||||
|
||||
{* ./docs_src/tutorial/relationship_attributes/define_relationship_attributes/tutorial001_py310.py ln[1:19] hl[9] *}
|
||||
|
||||
What's that about? Can't we just write it normally as `List[Hero]`?
|
||||
What's that about? Can't we just write it normally as `list[Hero]`?
|
||||
|
||||
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. 😭
|
||||
|
||||
|
||||
Reference in New Issue
Block a user