Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for valueOf (0.18 sec)

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

        ```Python hl_lines="24"
        {!> ../../../docs_src/response_model/tutorial004.py!}
        ```
    
    and those default values won't be included in the response, only the values actually set.
    
    So, if you send a request to that *path operation* for the item with ID `foo`, the response (not including default values) will be:
    
    ```JSON
    {
        "name": "Foo",
        "price": 50.2
    }
    ```
    
    !!! info
    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. tests/test_tutorial/test_header_params/test_tutorial003.py

    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"X-Token values": None}),
            ("/items", {"x-token": "foo"}, 200, {"X-Token values": ["foo"]}),
            (
                "/items",
                [("x-token", "foo"), ("x-token", "bar")],
                200,
                {"X-Token values": ["foo", "bar"]},
            ),
        ],
    )
    def test(path, headers, expected_status, expected_response):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 12 14:52:00 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial005.py!}
    ```
    
    #### Get the *enumeration value*
    
    You can get the actual value (a `str` in this case) using `model_name.value`, or in general, `your_enum_member.value`:
    
    ```Python hl_lines="20"
    {!../../../docs_src/path_params/tutorial005.py!}
    ```
    
    !!! tip
        You could also access the value `"lenet"` with `ModelName.lenet.value`.
    
    #### Return *enumeration members*
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. fastapi/param_functions.py

            Doc(
                """
                Default value if the parameter field is not set.
                """
            ),
        ] = Undefined,
        *,
        default_factory: Annotated[
            Union[Callable[[], Any], None],
            Doc(
                """
                A callable to generate the default value.
    
                This doesn't affect `Path` parameters as the value is always required.
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  5. fastapi/utils.py

    
    def deep_dict_update(main_dict: Dict[Any, Any], update_dict: Dict[Any, Any]) -> None:
        for key, value in update_dict.items():
            if (
                key in main_dict
                and isinstance(main_dict[key], dict)
                and isinstance(value, dict)
            ):
                deep_dict_update(main_dict[key], value)
            elif (
                key in main_dict
                and isinstance(main_dict[key], list)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/first-steps.md

    ### Step 5: return the content
    
    ```Python hl_lines="8"
    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    
    You can return a `dict`, `list`, singular values as `str`, `int`, etc.
    
    You can also return Pydantic models (you'll see more about that later).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 12K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/nosql-databases-couchbase.md

    ### `dict` unpacking
    
    If you are not familiar with the `UserInDB(**result.value)`, <a href="https://docs.python.org/3/glossary.html#term-argument" class="external-link" target="_blank">it is using `dict` "unpacking"</a>.
    
    It will take the `dict` at `result.value`, and take each of its keys and values and pass them as key-values to `UserInDB` as keyword arguments.
    
    So, if the `dict` contains:
    
    ```Python
    {
    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)
  8. docs/en/docs/python-types.md

    ```Python hl_lines="1"
    {!../../../docs_src/python_types/tutorial005.py!}
    ```
    
    ### Generic types with type parameters
    
    There are some data structures that can contain other values, like `dict`, `list`, `set` and `tuple`. And the internal values can have their own type too.
    
    These types that have internal types are called "**generic**" types. And it's possible to declare them, even with their internal types.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/header-params.md

        {!> ../../../docs_src/header_params/tutorial003.py!}
        ```
    
    与*路径操作*通信时,以下面的方式发送两个 HTTP 请求头:
    
    ```
    X-Token: foo
    X-Token: bar
    ```
    
    响应结果是:
    
    ```JSON
    {
        "X-Token values": [
            "bar",
            "foo"
        ]
    }
    ```
    
    ## 小结
    
    使用 `Header` 声明请求头的方式与 `Query`、`Path` 、`Cookie` 相同。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:42:51 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  10. docs/en/docs/release-notes.md

        * Add support for enumerations in *path operation* parameters. New documentation: [Path Parameters: Predefined values](https://fastapi.tiangolo.com/tutorial/path-params/#predefined-values).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
Back to top