Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 258 for defaults (0.21 sec)

  1. tests/test_skip_defaults.py

    )
    def get_exclude_unset() -> ModelDefaults:
        return ModelDefaults(x=None, y="y")
    
    
    @app.get(
        "/exclude_defaults",
        response_model=ModelDefaults,
        response_model_exclude_defaults=True,
    )
    def get_exclude_defaults() -> ModelDefaults:
        return ModelDefaults(x=None, y="y")
    
    
    @app.get(
        "/exclude_none", response_model=ModelDefaults, response_model_exclude_none=True
    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  2. tests/test_include_router_defaults_overrides.py

                    }
                },
                "/level1/level2/default5": {
                    "get": {
                        "tags": ["level1a", "level1b", "level2a", "level2b"],
                        "summary": "Path5 Default Router4 Default",
                        "operationId": "path5_default_router4_default_level1_level2_default5_get",
                        "parameters": [
                            {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/response-model.md

    * `tax: float = 10.5` has a default of `10.5`.
    * `tags: List[str] = []` has a default of an empty list: `[]`.
    
    but you might want to omit them from the result if they were not actually stored.
    
    For example, if you have models with many optional attributes in a NoSQL database, but you don't want to send very long JSON responses full of default values.
    
    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)
  4. docs/zh/docs/tutorial/response-model.md

    !!! info
        你还可以使用:
    
        * `response_model_exclude_defaults=True`
        * `response_model_exclude_none=True`
    
        参考 <a href="https://docs.pydantic.dev/latest/concepts/serialization/#modeldict" class="external-link" target="_blank">Pydantic 文档</a> 中对 `exclude_defaults` 和 `exclude_none` 的描述。
    
    #### 默认值字段有实际值的数据
    
    但是,如果你的数据在具有默认值的模型字段中有实际的值,例如 ID 为 `bar` 的项:
    
    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/en/docs/advanced/middleware.md

    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial003.py!}
    ```
    
    The following arguments are supported:
    
    * `minimum_size` - Do not GZip responses that are smaller than this minimum size in bytes. Defaults to `500`.
    
    ## Other middlewares
    
    There are many other ASGI middlewares.
    
    For example:
    
    * <a href="https://docs.sentry.io/platforms/python/guides/fastapi/" class="external-link" target="_blank">Sentry</a>
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/response-model.md

    !!! info "情報"
        以下も使用することができます:
    
        * `response_model_exclude_defaults=True`
        * `response_model_exclude_none=True`
    
        `exclude_defaults`と`exclude_none`については、<a href="https://docs.pydantic.dev/latest/concepts/serialization/#modeldict" class="external-link" target="_blank">Pydanticのドキュメント</a>で説明されている通りです。
    
    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)
  7. docs/en/docs/alternatives.md

    They are, more or less, at opposite ends, complementing each other.
    
    Requests has a very simple and intuitive design, it's very easy to use, with sensible defaults. But at the same time, it's very powerful and customizable.
    
    That's why, as said in the official website:
    
    > Requests is one of the most downloaded Python packages of all time
    
    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)
  8. docs/en/docs/how-to/nosql-databases-couchbase.md

    This utility function will:
    
    * Connect to a **Couchbase** cluster (that might be a single machine).
        * Set defaults for timeouts.
    * Authenticate in the cluster.
    * Get a `Bucket` instance.
        * Set defaults for timeouts.
    * Return it.
    
    ```Python hl_lines="12-21"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    ## Create Pydantic models
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  9. docs/en/docs/js/termynal.js

         * @param {string} options.progressChar – Character to use for progress bar, defaults to █.
    	 * @param {number} options.progressPercent - Max percent of progress.
         * @param {string} options.cursor – Character to use for cursor, defaults to ▋.
         * @param {Object[]} lineData - Dynamically loaded line data objects.
         * @param {boolean} options.noInit - Don't initialise the animation.
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 9.3K bytes
    - Viewed (0)
  10. fastapi/encoders.py

                exclude_none=exclude_none,
                exclude_defaults=exclude_defaults,
            )
            if "__root__" in obj_dict:
                obj_dict = obj_dict["__root__"]
            return jsonable_encoder(
                obj_dict,
                exclude_none=exclude_none,
                exclude_defaults=exclude_defaults,
                # TODO: remove when deprecating Pydantic v1
                custom_encoder=encoders,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
Back to top