Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 60 for unses (0.13 sec)

  1. docs/en/docs/tutorial/response-model.md

    ### Use the `response_model_exclude_unset` parameter
    
    You can set the *path operation decorator* parameter `response_model_exclude_unset=True`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="22"
        {!> ../../../docs_src/response_model/tutorial004_py310.py!}
        ```
    
    === "Python 3.9+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  2. docs/en/docs/benchmarks.md

    The hierarchy is like:
    
    * **Uvicorn**: an ASGI server
        * **Starlette**: (uses Uvicorn) a web microframework
            * **FastAPI**: (uses Starlette) an API microframework with several additional features for building APIs, with data validation, etc.
    
    * **Uvicorn**:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/body-updates.md

        `PATCH` 没有 `PUT` 知名,也怎么不常用。
    
        很多人甚至只用 `PUT` 实现部分更新。
    
        **FastAPI** 对此没有任何限制,可以**随意**互换使用这两种操作。
    
        但本指南也会分别介绍这两种操作各自的用途。
    
    ### 使用 Pydantic 的 `exclude_unset` 参数
    
    更新部分数据时,可以在 Pydantic 模型的 `.dict()` 中使用 `exclude_unset` 参数。
    
    比如,`item.dict(exclude_unset=True)`。
    
    这段代码生成的 `dict` 只包含创建 `item` 模型时显式设置的数据,而不包括默认值。
    
    然后再用它生成一个只含已设置(在请求中所发送)数据,且省略了默认值的 `dict`:
    
    ```Python hl_lines="34"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/response-model.md

    * `tags: List[str] = []` 具有一个空列表作为默认值: `[]`.
    
    但如果它们并没有存储实际的值,你可能想从结果中忽略它们的默认值。
    
    举个例子,当你在 NoSQL 数据库中保存了具有许多可选属性的模型,但你又不想发送充满默认值的很长的 JSON 响应。
    
    ### 使用 `response_model_exclude_unset` 参数
    
    你可以设置*路径操作装饰器*的 `response_model_exclude_unset=True` 参数:
    
    ```Python hl_lines="24"
    {!../../../docs_src/response_model/tutorial004.py!}
    ```
    
    然后响应中将不会包含那些默认值,而是仅有实际设置的值。
    
    因此,如果你向*路径操作*发送 ID 为 `foo` 的商品的请求,则响应(不包括默认值)将为:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/response-model.md

    しかし、実際に保存されていない場合には結果からそれらを省略した方が良いかもしれません。
    
    例えば、NoSQLデータベースに多くのオプション属性を持つモデルがあるが、デフォルト値でいっぱいの非常に長いJSONレスポンスを送信したくない場合です。
    
    ### `response_model_exclude_unset`パラメータの使用
    
    *path operation デコレータ*に`response_model_exclude_unset=True`パラメータを設定することができます:
    
    ```Python hl_lines="24"
    {!../../../docs_src/response_model/tutorial004.py!}
    ```
    
    そして、これらのデフォルト値はレスポンスに含まれず、実際に設定された値のみが含まれます。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/generate-clients.md

    ```TypeScript
    ItemsService.createItemItemsPost({name: "Plumbus", price: 5})
    ```
    
    ...that's because the client generator uses the OpenAPI internal **operation ID** for each *path operation*.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/behind-a-proxy.md

    And the version without the path prefix (`http://127.0.0.1:8000/app`), provided by Uvicorn directly, would be exclusively for the _proxy_ (Traefik) to access it.
    
    That demonstrates how the Proxy (Traefik) uses the path prefix and how the server (Uvicorn) uses the `root_path` from the option `--root-path`.
    
    ### Check the docs UI
    
    But here's the fun part. ✨
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 11.6K bytes
    - Viewed (2)
  8. docs/en/docs/alternatives.md

    Webargs is a tool that was made to provide that on top of several frameworks, including Flask.
    
    It uses Marshmallow underneath to do the data validation. And it was created by the same developers.
    
    It's a great tool and I have used it a lot too, before having **FastAPI**.
    
    !!! info
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  9. docs/en/docs/deployment/manually.md

    That would work for most of the cases. 😎
    
    You could use that command for example to start your **FastAPI** app in a container, in a server, etc.
    
    ## ASGI Servers
    
    Let's go a little deeper into the details.
    
    FastAPI uses a standard for building Python web frameworks and servers called <abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>. FastAPI is an ASGI web framework.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/dataclasses.md

    7. Here the `response_model` is using a type annotation of a list of `Author` dataclasses.
    
        Again, you can combine `dataclasses` with standard type annotations.
    
    8. Notice that this *path operation function* uses regular `def` instead of `async def`.
    
        As always, in FastAPI you can combine `def` and `async def` as needed.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
Back to top