- Sort Score
- Result 10 results
- Languages All
Results 451 - 460 of 890 for docs_src (0.23 sec)
-
docs/ja/docs/tutorial/dependencies/sub-dependencies.md
以下のような最初の依存関係(「依存可能なもの」)を作成することができます: ```Python hl_lines="8 9" {!../../docs_src/dependencies/tutorial005.py!} ``` これはオプショナルのクエリパラメータ`q`を`str`として宣言し、それを返すだけです。 これは非常にシンプルです(あまり便利ではありません)が、サブ依存関係がどのように機能するかに焦点を当てるのに役立ちます。 ### 第二の依存関係 「依存可能なもの」と「依存」 そして、別の依存関数(「依存可能なもの」)を作成して、同時にそれ自身の依存関係を宣言することができます(つまりそれ自身も「依存」です): ```Python hl_lines="13" {!../../docs_src/dependencies/tutorial005.py!} ``` 宣言されたパラメータに注目してみましょう:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 4.4K bytes - Viewed (0) -
docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md
```Python hl_lines="11 12 13 14 15" {!../../docs_src/dependencies/tutorial002.py!} ``` クラスのインスタンスを作成するために使用される`__init__`メソッドに注目してください: ```Python hl_lines="12" {!../../docs_src/dependencies/tutorial002.py!} ``` ...以前の`common_parameters`と同じパラメータを持っています: ```Python hl_lines="8" {!../../docs_src/dependencies/tutorial001.py!} ``` これらのパラメータは **FastAPI** が依存関係を「解決」するために使用するものです。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.2K bytes - Viewed (0) -
docs/en/docs/tutorial/first-steps.md
{* ../../docs_src/first_steps/tutorial001.py hl[7] *} This is a Python function. It will be called by **FastAPI** whenever it receives a request to the URL "`/`" using a `GET` operation. In this case, it is an `async` function. --- You could also define it as a normal function instead of `async def`: {* ../../docs_src/first_steps/tutorial003.py hl[7] *} /// note
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 26 11:48:16 UTC 2024 - 11.8K bytes - Viewed (0) -
tests/test_tutorial/test_additional_status_codes/test_tutorial001_an_py310.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture(name="client") def get_client(): from docs_src.additional_status_codes.tutorial001_an_py310 import app client = TestClient(app) return client @needs_py310 def test_update(client: TestClient): response = client.put("/items/foo", json={"name": "Wrestlers"}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 741 bytes - Viewed (0) -
docs/zh/docs/tutorial/security/first-steps.md
把下面的示例代码复制到 `main.py`: //// tab | Python 3.9+ ```Python {!> ../../docs_src/security/tutorial001_an_py39.py!} ``` //// //// tab | Python 3.8+ ```Python {!> ../../docs_src/security/tutorial001_an.py!} ``` //// //// tab | Python 3.8+ non-Annotated /// tip 尽可能选择使用 `Annotated` 的版本。 /// ```Python {!> ../../docs_src/security/tutorial001.py!} ``` //// ## 运行
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.3K bytes - Viewed (0) -
docs/zh/docs/advanced/openapi-callbacks.md
首先,新建包含一些用于回调的 `APIRouter`。 ```Python hl_lines="5 26" {!../../docs_src/openapi_callbacks/tutorial001.py!} ``` ### 创建回调*路径操作* 创建回调*路径操作*也使用之前创建的 `APIRouter`。 它看起来和常规 FastAPI *路径操作*差不多: * 声明要接收的请求体,例如,`body: InvoiceEvent` * 还要声明要返回的响应,例如,`response_model=InvoiceEventReceived` ```Python hl_lines="17-19 22-23 29-33" {!../../docs_src/openapi_callbacks/tutorial001.py!} ``` 回调*路径操作*与常规*路径操作*有两点主要区别:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.6K bytes - Viewed (0) -
docs/pt/docs/tutorial/request-forms-and-files.md
/// ## Importe `File` e `Form` ```Python hl_lines="1" {!../../docs_src/request_forms_and_files/tutorial001.py!} ``` ## Defina parâmetros de `File` e `Form` Crie parâmetros de arquivo e formulário da mesma forma que você faria para `Body` ou `Query`: ```Python hl_lines="8" {!../../docs_src/request_forms_and_files/tutorial001.py!} ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_py310.py
@needs_py310 def test_verify_password(): from docs_src.security.tutorial005_py310 import fake_users_db, verify_password assert verify_password("secret", fake_users_db["johndoe"]["hashed_password"]) @needs_py310 def test_get_password_hash(): from docs_src.security.tutorial005_py310 import get_password_hash assert get_password_hash("secretalice")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Mar 13 19:07:10 UTC 2024 - 16.3K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_py39.py
@needs_py39 def test_verify_password(): from docs_src.security.tutorial005_py39 import fake_users_db, verify_password assert verify_password("secret", fake_users_db["johndoe"]["hashed_password"]) @needs_py39 def test_get_password_hash(): from docs_src.security.tutorial005_py39 import get_password_hash assert get_password_hash("secretalice")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Mar 13 19:07:10 UTC 2024 - 16.3K bytes - Viewed (0) -
tests/test_tutorial/test_response_cookies/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_cookies.tutorial001 import app client = TestClient(app) def test_path_operation(): response = client.post("/cookie/") assert response.status_code == 200, response.text assert response.json() == {"message": "Come to the dark side, we have cookies"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 403 bytes - Viewed (0)