]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
📝 Update admonitions in annotations (#1065)
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 12 Aug 2024 21:38:19 +0000 (16:38 -0500)
committerGitHub <noreply@github.com>
Mon, 12 Aug 2024 21:38:19 +0000 (16:38 -0500)
docs_src/tutorial/automatic_id_none_refresh/annotations/en/tutorial002.md
docs_src/tutorial/delete/annotations/en/tutorial002.md
docs_src/tutorial/fastapi/app_testing/tutorial001/annotations/en/test_main_004.md
docs_src/tutorial/fastapi/app_testing/tutorial001_py310/annotations/en/test_main_004.md
docs_src/tutorial/fastapi/app_testing/tutorial001_py39/annotations/en/test_main_004.md
docs_src/tutorial/select/annotations/en/tutorial002.md
docs_src/tutorial/update/annotations/en/tutorial002.md
docs_src/tutorial/update/annotations/en/tutorial004.md

index 725fcb66014f1c4ade7724a672e4d8f2704ae441..fee38368dc2b6a4a046f069c92c1eb85b1e08d3f 100644 (file)
 
 33. Print the `hero_1`.
 
-    !!! info
-        Even if the `hero_1` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+    /// info
+
+    Even if the `hero_1` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+
+    ///
 
     Because the `hero_1` is fresh it has all it's data available.
 
 
 34. Print the `hero_2`.
 
-    !!! info
-        Even if the `hero_2` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+    /// info
+
+    Even if the `hero_2` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+
+    ///
 
     Because the `hero_2` is fresh it has all it's data available.
 
 
 35. Print the `hero_3`.
 
-    !!! info
-        Even if the `hero_3` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+    /// info
+
+    Even if the `hero_3` wasn't fresh, this would **not** trigger a `refresh` making the **session** use the **engine** to fetch data from the database because it is not accessing an attribute.
+
+    ///
 
     Because the `hero_3` is fresh it has all it's data available.
 
index 28dcc50fb3166d4572eb34b993788d31f105ca58..a6971f67d5eee84642204cbad148426e3bcfb0f6 100644 (file)
 
 3. Get one hero object, expecting exactly one.
 
-    !!! tip
-        This ensures there's no more than one, and that there's exactly one, not `None`.
+    /// tip
 
-        This would never return `None`, instead it would raise an exception.
+    This ensures there's no more than one, and that there's exactly one, not `None`.
+
+    This would never return `None`, instead it would raise an exception.
+
+    ///
 
 4. Print the hero object.
 
index 92cbe774418246b60382e889b954bd4e98ab5fef..de754c5e763a18ed1fa71cf0f4b9008aec34064f 100644 (file)
@@ -22,5 +22,8 @@
 
     We tell it that with the `poolclass=StaticPool` parameter.
 
-    !!! info
-        You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+    /// info
+
+    You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+
+    ///
index 92cbe774418246b60382e889b954bd4e98ab5fef..de754c5e763a18ed1fa71cf0f4b9008aec34064f 100644 (file)
@@ -22,5 +22,8 @@
 
     We tell it that with the `poolclass=StaticPool` parameter.
 
-    !!! info
-        You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+    /// info
+
+    You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+
+    ///
index 92cbe774418246b60382e889b954bd4e98ab5fef..de754c5e763a18ed1fa71cf0f4b9008aec34064f 100644 (file)
@@ -22,5 +22,8 @@
 
     We tell it that with the `poolclass=StaticPool` parameter.
 
-    !!! info
-        You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+    /// info
+
+    You can read more details in the <a href="https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#using-a-memory-database-in-multiple-threads" class="external-link" target="_blank">SQLAlchemy documentation about Using a Memory Database in Multiple Threads</a>
+
+    ///
index 312bd81a94133be37d43fad3bbe9a19c6c046646..fa7e6f3a55750496d84b9d4f2cfed8a8b9042813 100644 (file)
 
 7. Create a new **session** to query data.
 
-    !!! tip
-        Notice that this is a new **session** independent from the one in the other function above.
+    /// tip
 
-        But it still uses the same **engine**. We still have one engine for the whole application.
+    Notice that this is a new **session** independent from the one in the other function above.
+
+    But it still uses the same **engine**. We still have one engine for the whole application.
+
+    ///
 
 8. Use the `select()` function to create a statement selecting all the `Hero` objects.
 
index eb1a820c0bb097308a62a3289da75770c346a526..7cb7c28ba89c4fc6991c12489429ae23e703cd12 100644 (file)
 
 3. Get one hero object, expecting exactly one.
 
-    !!! tip
-        This ensures there's no more than one, and that there's exactly one, not `None`.
+    /// tip
 
-        This would never return `None`, instead it would raise an exception.
+    This ensures there's no more than one, and that there's exactly one, not `None`.
+
+    This would never return `None`, instead it would raise an exception.
+
+    ///
 
 4. Print the hero object.
 
index 8378d1b3a7faa92c1555e93c30078e39ebad3ddc..bbb713ead5a3c266d550b2b8ce69d5a90f3b625c 100644 (file)
     INFO Engine [no key 0.00020s] ('Captain North America',)
     ```
 
-    !!! tip
-        See the `BEGIN` at the top?
+    /// tip
 
-        This is SQLAlchemy automatically starting a transaction for us.
+    See the `BEGIN` at the top?
 
-        This way, we could revert the last changes (if there were some) if we wanted to, even if the SQL to create them was already sent to the database.
+    This is SQLAlchemy automatically starting a transaction for us.
+
+    This way, we could revert the last changes (if there were some) if we wanted to, even if the SQL to create them was already sent to the database.
+
+    ///
 
 7. Get one hero object for this new query.
 
     INFO Engine COMMIT
     ```
 
-    !!! tip
-        See how SQLAlchemy (that powers SQLModel) optimizes the SQL to do as much work as possible in a single batch.
+    /// tip
+
+    See how SQLAlchemy (that powers SQLModel) optimizes the SQL to do as much work as possible in a single batch.
+
+    Here it updates both heroes in a single SQL query.
 
-        Here it updates both heroes in a single SQL query.
+    ///
 
 16. Refresh the first hero.
 
     INFO Engine [generated in 0.00023s] (2,)
     ```
 
-    !!! tip
-        Because we just committed a SQL transaction with `COMMIT`, SQLAlchemy will automatically start a new transaction with `BEGIN`.
+    /// tip
+
+    Because we just committed a SQL transaction with `COMMIT`, SQLAlchemy will automatically start a new transaction with `BEGIN`.
+
+    ///
 
 17. Refresh the second hero.
 
     INFO Engine [cached since 0.001709s ago] (7,)
     ```
 
-    !!! tip
-        SQLAlchemy is still using the previous transaction, so it doesn't have to create a new one.
+    /// tip
+
+    SQLAlchemy is still using the previous transaction, so it doesn't have to create a new one.
+
+    ///
 
 18. Print the first hero, now updated.