Search Options

Results per page
Sort
Preferred Languages
Advance

Results 511 - 520 of 874 for tutorial001 (0.14 sec)

  1. docs/zh/docs/tutorial/path-params.md

    ```Python hl_lines="16"
    {!../../docs_src/path_params/tutorial005.py!}
    ```
    
    ### 查看文档
    
     API 文档会显示预定义*路径参数*的可用值:
    
    <img src="/img/tutorial/path-params/image03.png">
    
    ### 使用 Python _枚举类型_
    
    *路径参数*的值是枚举的元素。
    
    #### 比较*枚举元素*
    
    枚举类 `ModelName` 中的*枚举元素*支持比较操作:
    
    ```Python hl_lines="17"
    {!../../docs_src/path_params/tutorial005.py!}
    ```
    
    #### 获取*枚举值*
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/security/get-current-user.md

    ```Python hl_lines="25"
    {!../../docs_src/security/tutorial002.py!}
    ```
    
    ## 获取用户
    
    `get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型:
    
    ```Python hl_lines="19-22  26-27"
    {!../../docs_src/security/tutorial002.py!}
    ```
    
    ## 注入当前用户
    
    在*路径操作* 的 `Depends` 中使用 `get_current_user`:
    
    ```Python hl_lines="31"
    {!../../docs_src/security/tutorial002.py!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/response-model.md

    ```Python hl_lines="17  22  24-27"
    {!> ../../docs_src/response_model/tutorial001_py39.py!}
    ```
    
    ////
    
    //// tab | Python 3.8+
    
    ```Python hl_lines="17  22  24-27"
    {!> ../../docs_src/response_model/tutorial001.py!}
    ```
    
    ////
    
    /// note
    
    Notice that `response_model` is a parameter of the "decorator" method (`get`, `post`, etc). Not of your *path operation function*, like all the parameters and body.
    
    ///
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 18.1K bytes
    - Viewed (0)
  4. docs/ja/docs/tutorial/body-nested-models.md

    ```Python hl_lines="12"
    {!../../docs_src/body_nested_models/tutorial001.py!}
    ```
    
    これにより、各項目の型は宣言されていませんが、`tags`はある項目のリストになります。
    
    ## タイプパラメータを持つリストのフィールド
    
    しかし、Pythonには型や「タイプパラメータ」を使ってリストを宣言する方法があります:
    
    ### typingの`List`をインポート
    
    まず、Pythonの標準の`typing`モジュールから`List`をインポートします:
    
    ```Python hl_lines="1"
    {!../../docs_src/body_nested_models/tutorial002.py!}
    ```
    
    ### タイプパラメータを持つ`List`の宣言
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/testing-dependencies.md

    ```
    
    ////
    
    //// tab | Python 3.8+ non-Annotated
    
    /// tip
    
    Prefer to use the `Annotated` version if possible.
    
    ///
    
    ```Python hl_lines="28-29  32"
    {!> ../../docs_src/dependency_testing/tutorial001.py!}
    ```
    
    ////
    
    /// tip
    
    You can set a dependency override for a dependency used anywhere in your **FastAPI** application.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/query-params-str-validations.md

    ### `Query`のインポート
    
    そのために、まずは`fastapi`から`Query`をインポートします:
    
    ```Python hl_lines="3"
    {!../../docs_src/query_params_str_validations/tutorial002.py!}
    ```
    
    ## デフォルト値として`Query`を使用
    
    パラメータのデフォルト値として使用し、パラメータ`max_length`を50に設定します:
    
    ```Python hl_lines="9"
    {!../../docs_src/query_params_str_validations/tutorial002.py!}
    ```
    
    デフォルト値`None`を`Query(default=None)`に置き換える必要があるので、`Query`の最初の引数はデフォルト値を定義するのと同じです。
    
    なので:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  7. docs/de/docs/advanced/additional-responses.md

    Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, können Sie schreiben:
    
    ```Python hl_lines="18  22"
    {!../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    /// note | "Hinweis"
    
    Beachten Sie, dass Sie die `JSONResponse` direkt zurückgeben müssen.
    
    ///
    
    /// info
    
    Der `model`-Schlüssel ist nicht Teil von OpenAPI.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/additional-responses.md

    For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write:
    
    {* ../../docs_src/additional_responses/tutorial001.py hl[18,22] *}
    
    /// note
    
    Keep in mind that you have to return the `JSONResponse` directly.
    
    ///
    
    /// info
    
    The `model` key is not part of OpenAPI.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 16:07:07 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  9. docs/fr/docs/advanced/additional-responses.md

    Par exemple, pour déclarer une autre réponse avec un code HTTP `404` et un modèle Pydantic `Message`, vous pouvez écrire :
    
    ```Python hl_lines="18 22"
    {!../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    /// note | "Remarque"
    
    Gardez à l'esprit que vous devez renvoyer directement `JSONResponse`.
    
    ///
    
    /// info
    
    La clé `model` ne fait pas partie d'OpenAPI.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/metadata.md

    ```Python hl_lines="3-16  18"
    {!../../docs_src/metadata/tutorial004.py!}
    ```
    
    설명 안에 마크다운을 사용할 수 있습니다. 예를 들어 "login"은 굵게(**login**) 표시되고, "fancy"는 기울임꼴(_fancy_)로 표시됩니다.
    
    /// tip
    
    사용 중인 모든 태그에 메타데이터를 추가할 필요는 없습니다.
    
    ///
    
    ### 태그 사용
    
    `tags` 매개변수를 *경로 작동* 및 `APIRouter`와 함께 사용하여 태그에 할당할 수 있습니다:
    
    ```Python hl_lines="21  26"
    {!../../docs_src/metadata/tutorial004.py!}
    ```
    
    /// info
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 29 10:36:06 UTC 2024
    - 6.5K bytes
    - Viewed (0)
Back to top