Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for Age (0.13 sec)

  1. tests/test_union_inherited_body.py

    class Item(BaseModel):
        name: Optional[str] = None
    
    
    class ExtendedItem(Item):
        age: int
    
    
    @app.post("/items/")
    def save_union_different_body(item: Union[ExtendedItem, Item]):
        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_post_extended_item():
        response = client.post("/items/", json={"name": "Foo", "age": 5})
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  2. docs/ru/docs/python-types.md

    ```
    
    Поскольку редактор знает типы переменных, вы получаете не только дополнение, но и проверки ошибок:
    
    <img src="/img/python-types/image04.png">
    
    Теперь вы знаете, что вам нужно исправить, преобразовав `age` в строку с `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Объявление типов
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  3. docs/uk/docs/python-types.md

    Оскільки редактор знає типи змінних, ви не тільки отримаєте автозаповнення, ви також отримаєте перевірку помилок:
    
    <img src="/img/python-types/image04.png">
    
    Тепер ви знаєте, щоб виправити це, вам потрібно перетворити `age` у строку з допомогою `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Оголошення типів
    
    Щойно ви побачили основне місце для оголошення анотацій типу. Як параметри функції.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  4. tests/test_multi_body_errors.py

                        "loc": ["body", 0, "age"],
                        "msg": "ensure this value is greater than 0",
                        "type": "value_error.number.not_gt",
                    }
                ]
            }
        )
    
    
    def test_put_incorrect_body_multiple():
        response = client.post("/items/", json=[{"age": "five"}, {"age": "six"}])
        assert response.status_code == 422, response.text
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  5. docs/en/docs/python-types.md

    ```
    
    Because the editor knows the types of the variables, you don't only get completion, you also get error checks:
    
    <img src="/img/python-types/image04.png">
    
    Now you know that you have to fix it, convert `age` to a string with `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Declaring types
    
    You just saw the main place to declare type hints. As function parameters.
    
    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)
  6. docs/ru/docs/tutorial/cors.md

    * `expose_headers` - Указывает любые заголовки ответа, которые должны быть доступны браузеру. По умолчанию равно `[]`.
    * `max_age` - Устанавливает максимальное время в секундах, в течение которого браузер кэширует CORS-ответы. По умолчанию равно `600`.
    
    `CORSMiddleware` отвечает на два типа HTTP-запросов...
    
    ### CORS-запросы с предварительной проверкой
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jun 22 14:29:56 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  7. docs/tr/docs/python-types.md

    {!../../../docs_src/python_types/tutorial003.py!}
    ```
    
    Editör değişkenlerin tiplerini bildiğinden, yalnızca otomatik tamamlama değil, hata kontrolleri de sağlar:
    
    <img src="/img/python-types/image04.png">
    
    Artık `age` değişkenini `str(age)` olarak kullanmanız gerektiğini biliyorsunuz:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Tip bildirme
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 9.7K bytes
    - Viewed (0)
  8. docs/es/docs/python-types.md

    <img src="https://fastapi.tiangolo.com/img/python-types/image04.png">
    
    Ahora que sabes que tienes que arreglarlo convierte `age` a un string con `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Declarando tipos
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  9. docs/pt/docs/python-types.md

    Como o editor conhece os tipos de variáveis, você não apenas obtém a conclusão, mas também as verificações de erro:
    
    <img src="/img/python-types/image04.png">
    
    Agora você sabe que precisa corrigí-lo, converta `age` em uma string com `str (age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Tipos de declaração
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  10. docs/fr/docs/python-types.md

    <img src="/img/python-types/image04.png">
    
    Maintenant que vous avez connaissance du problème, convertissez `age` en <abbr title="string">chaîne de caractères</abbr> grâce à `str(age)` :
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Déclarer des types
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10.3K bytes
    - Viewed (0)
Back to top