Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 284 for union (0.21 sec)

  1. docs/fr/docs/tutorial/query-params-str-validations.md

    ```
    
    Le paramètre de requête `q` a pour type `Union[str, None]` (ou `str | None` en Python 3.10), signifiant qu'il est de type `str` mais pourrait aussi être égal à `None`, et bien sûr, la valeur par défaut est `None`, donc **FastAPI** saura qu'il n'est pas requis.
    
    !!! note
        **FastAPI** saura que la valeur de `q` n'est pas requise grâce à la valeur par défaut `= None`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 27 18:53:21 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  2. docs/em/docs/tutorial/query-params-str-validations.md

        {!> ../../../docs_src/query_params_str_validations/tutorial001_py310.py!}
        ```
    
    🔢 🔢 `q` 🆎 `Union[str, None]` (⚖️ `str | None` 🐍 3️⃣.1️⃣0️⃣), 👈 ⛓ 👈 ⚫️ 🆎 `str` ✋️ 💪 `None`, & 👐, 🔢 💲 `None`, FastAPI 🔜 💭 ⚫️ 🚫 ✔.
    
    !!! note
        FastAPI 🔜 💭 👈 💲 `q` 🚫 ✔ ↩️ 🔢 💲 `= None`.
    
         `Union` `Union[str, None]` 🔜 ✔ 👆 👨‍🎨 🤝 👆 👍 🐕‍🦺 & 🔍 ❌.
    
    ## 🌖 🔬
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  3. docs/en/docs/python-types.md

        ```
    
    #### Using `Union` or `Optional`
    
    If you are using a Python version below 3.10, here's a tip from my very **subjective** point of view:
    
    * 🚨 Avoid using `Optional[SomeType]`
    * Instead ✨ **use `Union[SomeType, None]`** ✨.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  4. docs/uk/docs/python-types.md

        * Значення цього `dict` типу `float` (наприклад, ціна кожного елементу).
    
    #### Union (об'єднання)
    
    Ви можете оголосити, що змінна може бути будь-яким із **кількох типів**, наприклад, `int` або `str`.
    
    У Python 3.6 і вище (включаючи Python 3.10) ви можете використовувати тип `Union` з `typing` і вставляти в квадратні дужки можливі типи, які можна прийняти.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/query-params-str-validations.md

    ```
    
    O parâmetro de consulta `q` é do tipo `Union[str, None]`, o que significa que é do tipo `str` mas que também pode ser `None`, e de fato, o valor padrão é `None`, então o FastAPI saberá que não é obrigatório.
    
    !!! note "Observação"
        O FastAPI saberá que o valor de `q` não é obrigatório por causa do valor padrão `= None`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 9.3K bytes
    - Viewed (0)
  6. docs/pl/docs/index.md

    ## Przykład
    
    ### Stwórz
    
    * Utwórz plik o nazwie `main.py` z:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.4K bytes
    - Viewed (0)
  7. docs/ru/docs/index.md

    ### Создание
    
    * Создайте файл `main.py` со следующим содержимым:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 25.8K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/extra-models.md

    !!! note "Hinweis"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/query-params-str-validations.md

    ```Python
    q: str
    ```
    
    вместо:
    
    ```Python
    q: Union[str, None] = None
    ```
    
    Но у нас query-параметр определён как `Query`. Например:
    
    === "Annotated"
    
        ```Python
        q: Annotated[Union[str, None], Query(min_length=3)] = None
        ```
    
    === "без Annotated"
    
        ```Python
        q: Union[str, None] = Query(default=None, min_length=3)
        ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 38K bytes
    - Viewed (0)
  10. docs/zh/docs/index.md

    </div>
    
    ## 示例
    
    ### 创建
    
    * 创建一个 `main.py` 文件并写入以下内容:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 18.2K bytes
    - Viewed (0)
Back to top