]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
✏️ Fix typos found with codespell (#520)
authorKian-Meng Ang <kianmeng.ang@gmail.com>
Sun, 22 Oct 2023 12:50:44 +0000 (20:50 +0800)
committerGitHub <noreply@github.com>
Sun, 22 Oct 2023 12:50:44 +0000 (16:50 +0400)
Found via `codespell -S *.svg,*.css,*.js,*.drawio -L pullrequest,sesion`

17 files changed:
docs/tutorial/automatic-id-none-refresh.md
docs/tutorial/code-structure.md
docs/tutorial/connect/create-connected-tables.md
docs/tutorial/create-db-and-table-with-db-browser.md
docs/tutorial/fastapi/tests.md
docs/tutorial/index.md
docs/tutorial/insert.md
docs/tutorial/many-to-many/create-data.md
docs/tutorial/one.md
docs/tutorial/relationship-attributes/back-populates.md
docs/tutorial/relationship-attributes/read-relationships.md
docs/tutorial/select.md
docs/tutorial/where.md
docs_src/tutorial/automatic_id_none_refresh/annotations/en/tutorial002.md
docs_src/tutorial/update/annotations/en/tutorial004.md
sqlmodel/default.py
tests/test_validation.py

index bbf74dd3073e56ed28c8e4709738680a9ed99724..d41cd14e914e0bda7fbeffaabc432aa332aa386a 100644 (file)
@@ -36,7 +36,7 @@ When we create a new `Hero` instance, we don't set the `id`:
 
 {!./docs_src/tutorial/automatic_id_none_refresh/tutorial001.py[ln:23-26]!}
 
-# Code below ommitted 👇
+# Code below omitted 👇
 ```
 
 <details>
@@ -125,7 +125,7 @@ We can verify by creating a session using a `with` block and adding the objects.
 
 {!./docs_src/tutorial/automatic_id_none_refresh/tutorial001.py[ln:23-41]!}
 
-# Code below ommitted 👇
+# Code below omitted 👇
 ```
 
 <details>
@@ -238,7 +238,7 @@ To confirm and understand how this **automatic expiration and refresh** of data
 
 {!./docs_src/tutorial/automatic_id_none_refresh/tutorial001.py[ln:33-58]!}
 
-# Code below ommitted 👇
+# Code below omitted 👇
 ```
 
 <details>
@@ -271,7 +271,7 @@ Let's see how it works:
 ```console
 $ python app.py
 
-// Output above ommitted 👆
+// Output above omitted 👆
 
 // After committing, the objects are expired and have no values
 After committing the session
@@ -335,7 +335,7 @@ You can do that too with `session.refresh(object)`:
 
 {!./docs_src/tutorial/automatic_id_none_refresh/tutorial001.py[ln:33-67]!}
 
-# Code below ommitted 👇
+# Code below omitted 👇
 ```
 
 <details>
@@ -362,7 +362,7 @@ Here's how the output would look like:
 ```console
 $ python app.py
 
-// Output above ommitted 👆
+// Output above omitted 👆
 
 // The first refresh
 INFO Engine SELECT hero.id, hero.name, hero.secret_name, hero.age 
@@ -427,7 +427,7 @@ And the output shows again the same data:
 ```console
 $ python app.py
 
-// Output above ommitted 👆
+// Output above omitted 👆
 
 // By finishing the with block, the Session is closed, including a rollback of any pending transaction that could have been there and was not committed
 INFO Engine ROLLBACK
index 59a9e4bd9a6a67983391a3b4f8efcac6ed8935a5..502c8bf9585f5fccbc6608c954cecc4434bf2a2d 100644 (file)
@@ -168,7 +168,7 @@ Let's assume that now the file structure is:
 
 ### Circular Imports and Type Annotations
 
-The problem with circular imports is that Python can't resolve them at <abbr title="While it is executing the program, as oposed to the code as just text in a file stored on disk.">*runtime*</abbr>.
+The problem with circular imports is that Python can't resolve them at <abbr title="While it is executing the program, as opposed to the code as just text in a file stored on disk.">*runtime*</abbr>.
 
 But when using Python **type annotations** it's very common to need to declare the type of some variables with classes imported from other files.
 
index 452c904ebe979b457e263e034b95a2363915962c..14a310f59db8a54e7e37943ac67b738bab1e4bf1 100644 (file)
@@ -106,7 +106,7 @@ This is the same model we have been using up to now, we are just adding the new
 
 Most of that should look familiar:
 
-The column will be named `team_id`. It will be an integer, and it could be `NULL` in the database (or `None` in Python), becase there could be some heroes that don't belong to any team.
+The column will be named `team_id`. It will be an integer, and it could be `NULL` in the database (or `None` in Python), because there could be some heroes that don't belong to any team.
 
 We add a default of `None` to the `Field()` so we don't have to explicitly pass `team_id=None` when creating a hero.
 
index a1bb394024d81e5c451ccd2daaaf6542eb55b979..4437f15a6d39d7d5269072b8a51d9ba527283259 100644 (file)
@@ -164,6 +164,6 @@ Of course, you can also go and take a full SQL course or read a book about SQL,
 
 We saw how to interact with SQLite databases in files using **DB Browser for SQLite** in a visual user interface.
 
-We also saw how to use it to write some SQL directly to the SQLite database. This will be useful to verify the data in the database is looking correclty, to debug, etc.
+We also saw how to use it to write some SQL directly to the SQLite database. This will be useful to verify the data in the database is looking correctly, to debug, etc.
 
 In the next chapters we will start using **SQLModel** to interact with the database, and we will continue to use **DB Browser for SQLite** at the same time to look at the database underneath. 🔍
index f817a883a1353c6852e25c9277f64b9867dce9f1..cc6ad65c6f4d4715a789a7d9500e8642d76885c3 100644 (file)
@@ -82,7 +82,7 @@ But now, we need to deal with a bit of logistics and details we are not paying a
 
 This test looks fine, but there's a problem.
 
-If we run it, it will use the same **production database** that we are using to store our very important **heroes**, and we will end up adding unnecesary data to it, or even worse, in future tests we could end up removing production data.
+If we run it, it will use the same **production database** that we are using to store our very important **heroes**, and we will end up adding unnecessary data to it, or even worse, in future tests we could end up removing production data.
 
 So, we should use an independent **testing database**, just for the tests.
 
index 79fa670cfd456e953065885eba1ce69284ac7556..e8594148d68459b75e0e2909eff637cfa79e83bf 100644 (file)
@@ -135,7 +135,7 @@ Here are the commands you could use:
     // Remember that you might need to use python3.9 or similar 💡 
     // Create the virtual environment using the module "venv"
     $ python3 -m venv env
-    // ...here it creates the virtual enviroment in the directory "env"
+    // ...here it creates the virtual environment in the directory "env"
     // Activate the virtual environment
     $ source ./env/bin/activate
     // Verify that the virtual environment is active
@@ -157,7 +157,7 @@ Here are the commands you could use:
     ```console
     // Create the virtual environment using the module "venv"
     # >$ python3 -m venv env
-    // ...here it creates the virtual enviroment in the directory "env"
+    // ...here it creates the virtual environment in the directory "env"
     // Activate the virtual environment
     # >$ .\env\Scripts\Activate.ps1
     // Verify that the virtual environment is active
index 5947e1e5dccdcff049d8b1a8b2811c97f2d5d4e1..ecf87adbad63a6db48fb52131b8b4d93b7e6477d 100644 (file)
@@ -171,7 +171,7 @@ The first step is to import the `Session` class:
 ```Python hl_lines="3"
 {!./docs_src/tutorial/insert/tutorial001.py[ln:1-3]!}
 
-# Code below ommitted 👇
+# Code below omitted 👇
 ```
 
 <details>
index 22afb7ce7e54ab04d231e121cb7e8023992aed93..2a51f5acaeb6cb28b9262f0dec830c5bc5a1f8bd 100644 (file)
@@ -179,4 +179,4 @@ INFO Engine ROLLBACK
 
 ## Recap
 
-After setting up the model link, using it with **relationship attributes** is fairly straighforward, just Python objects. ✨
+After setting up the model link, using it with **relationship attributes** is fairly straightforward, just Python objects. ✨
index 3b60653ed988188a2fb8e4572b1989e799b099f7..f06343f67f02c950ec8fa22a10d2e34a08e0c2eb 100644 (file)
@@ -12,7 +12,7 @@ Let's see the utilities to read a single row.
 
 ## Continue From Previous Code
 
-We'll continue with the same examples we have been using in the previous chapters to create and select data and we'll keep udpating them.
+We'll continue with the same examples we have been using in the previous chapters to create and select data and we'll keep updating them.
 
 <details>
 <summary>👀 Full file preview</summary>
index 86a4c2a70a1a40a8e258caa35a7fae25b3b58b6f..27129a066c76c70fb3f76d28825f3f8665879bc4 100644 (file)
@@ -123,7 +123,7 @@ Now let's update **Spider-Boy**, removing him from the team by setting `hero_spi
 
 </details>
 
-The first important thing is, we *haven't commited* the hero yet, so accessing the list of heroes would not trigger an automatic refresh.
+The first important thing is, we *haven't committed* the hero yet, so accessing the list of heroes would not trigger an automatic refresh.
 
 But in our code, in this exact point in time, we already said that **Spider-Boy** is no longer part of the **Preventers**. 🔥
 
index 181b229589e7b242db12d7e069e55cb13ae8d565..c970b5eb060e7e143101be1cc8a034e3a25a6b7c 100644 (file)
@@ -52,7 +52,7 @@ With what we have learned **up to now**, we could use a `select()` statement, th
 
 ## Get Relationship Team - New Way
 
-But now that we have the **relationship attributes**, we can just access them, and **SQLModel** (actually SQLAlchemy) will go and fetch the correspoinding data from the database, and make it available in the attribute. ✨
+But now that we have the **relationship attributes**, we can just access them, and **SQLModel** (actually SQLAlchemy) will go and fetch the corresponding data from the database, and make it available in the attribute. ✨
 
 So, the highlighted block above, has the same results as the block below:
 
index fb638c12128cd02a0335ab759116a2007b2d2c41..5de32db5a1ccd12941582242ddbd77752566a392 100644 (file)
@@ -190,7 +190,7 @@ First we have to import `select` from `sqlmodel` at the top of the file:
 ```Python hl_lines="3"
 {!./docs_src/tutorial/select/tutorial001.py[ln:1-3]!}
 
-# More code below ommitted 👇
+# More code below omitted 👇
 ```
 
 <details>
@@ -472,7 +472,7 @@ SQLAlchemy's own `Session` has a method `session.execute()`. It doesn't have a `
 
 If you see SQLAlchemy tutorials, they will always use `session.execute()`.
 
-**SQLModel**'s own `Session` inherits directly from SQLAlchemy's `Session`, and adds this additonal method `session.exec()`. Underneath, it uses the same `session.execute()`.
+**SQLModel**'s own `Session` inherits directly from SQLAlchemy's `Session`, and adds this additional method `session.exec()`. Underneath, it uses the same `session.execute()`.
 
 But `session.exec()` does several **tricks** combined with the tricks in `session()` to give you the **best editor support**, with **autocompletion** and **inline errors** everywhere, even after getting data from a select. ✨
 
index ca85a4dd00582f5d563513790ef7038c115bf08d..47f1b9b113db857dc6159b46ee897826db2aeb73 100644 (file)
@@ -206,7 +206,7 @@ We care specially about the **select** statement:
 
 ## Filter Rows Using `WHERE` with **SQLModel**
 
-Now, the same way that we add `WHERE` to a SQL statement to filter rows, we can add a `.where()` to a **SQLModel** `select()` statment to filter rows, which will filter the objects returned:
+Now, the same way that we add `WHERE` to a SQL statement to filter rows, we can add a `.where()` to a **SQLModel** `select()` statement to filter rows, which will filter the objects returned:
 
 ```Python hl_lines="5"
 # Code above omitted 👆
@@ -748,7 +748,7 @@ FROM hero
 WHERE hero.age >= ? AND hero.age < ?
 INFO Engine [no key 0.00014s] (35, 40)
 
-// The two heros printed
+// The two heroes printed
 age=35 id=5 name='Black Lion' secret_name='Trevor Challa'
 age=36 id=6 name='Dr. Weird' secret_name='Steve Weird'
 
index fd33fec778bee26b2eab708da422f477cfcbc72b..8306d9b8983029547ee1c2bc061e154d6e88c408 100644 (file)
     Hero 3:
     ```
 
-21. Print the line `"After commiting the session, show IDs"`.
+21. Print the line `"After committing the session, show IDs"`.
 
     Generates the output:
 
index 55755cd88dbfbf808151ed6d0767f7f43d810458..3fcf1040ec7d47b13fab1217daf45a652c263a51 100644 (file)
     !!! tip
         SQLAlchemy is still using the previous transaction, so it doesn't have to create a new one.
 
-18. Print the first hero, now udpated.
+18. Print the first hero, now updated.
 
     This generates the output:
 
index bb44972e244177f1702e68e8ca657e1d15807c75..e8e37a5566b5e5fed3d9ac49b298b43dd009a3d9 100644 (file)
@@ -6,7 +6,7 @@ class _DefaultPlaceholder:
     You shouldn't use this class directly.
 
     It's used internally to recognize when a default value has been overwritten, even
-    if the overriden default value was truthy.
+    if the overridden default value was truthy.
     """
 
     def __init__(self, value: Any):
@@ -27,6 +27,6 @@ def Default(value: _TDefaultType) -> _TDefaultType:
     You shouldn't use this function directly.
 
     It's used internally to recognize when a default value has been overwritten, even
-    if the overriden default value was truthy.
+    if the overridden default value was truthy.
     """
     return _DefaultPlaceholder(value)  # type: ignore
index a3ff6e39ba0643c492333beddebe5c937670dece..ad60fcb945e285cfc7044a9cdd8ecd1cc083a3ed 100644 (file)
@@ -7,7 +7,7 @@ from sqlmodel import SQLModel
 
 
 def test_validation(clear_sqlmodel):
-    """Test validation of implicit and explict None values.
+    """Test validation of implicit and explicit None values.
 
     # For consistency with pydantic, validators are not to be called on
     # arguments that are not explicitly provided.