Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 264 for defaults (0.18 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 Apr 28 07:19:10 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  5. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.9K 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 Apr 28 07:19:10 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 Apr 28 07:19:10 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  9. fastapi/params.py

            json_schema_extra: Union[Dict[str, Any], None] = None,
            **extra: Any,
        ):
            assert default is ..., "Path parameters cannot have a default value"
            self.in_ = self.in_
            super().__init__(
                default=default,
                default_factory=default_factory,
                annotation=annotation,
                alias=alias,
                alias_priority=alias_priority,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  10. fastapi/param_functions.py

            item_id: Annotated[int, Path(title="The ID of the item to get")],
        ):
            return {"item_id": item_id}
        ```
        """
        return params.Path(
            default=default,
            default_factory=default_factory,
            alias=alias,
            alias_priority=alias_priority,
            validation_alias=validation_alias,
            serialization_alias=serialization_alias,
            title=title,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
Back to top