- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 96 for 50 (0.13 sec)
-
docs_src/query_params_str_validations/tutorial004_an.py
from fastapi import FastAPI, Query from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query(min_length=3, max_length=50, pattern="^fixedquery$") ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 410 bytes - Viewed (0) -
tests/test_tutorial/test_settings/test_app02.py
from docs_src.settings.app02 import main monkeypatch.setenv("ADMIN_EMAIL", "******@****.***") settings = main.get_settings() assert settings.app_name == "Awesome API" assert settings.items_per_user == 50 @needs_pydanticv2 def test_override_settings(): from docs_src.settings.app02 import test_main
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 488 bytes - Viewed (0) -
tests/test_tutorial/test_settings/test_tutorial001.py
response = client.get("/info") assert response.status_code == 200, response.text assert response.json() == { "app_name": "Awesome API", "admin_email": "******@****.***", "items_per_user": 50,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 552 bytes - Viewed (0) -
docs/ru/docs/fastapi-people.md
Оказывая помощь многим другим, они подтвердили свой уровень знаний. ✨ {% if people %} <div class="user-list user-list-center"> {% for user in people.experts[:50] %}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.6K bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial010_an.py
alias="item-query", title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3, max_length=50, pattern="^fixedquery$", deprecated=True, ), ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 664 bytes - Viewed (0) -
docs/en/docs/fastapi-people.md
{% if people %} <div class="user-list user-list-center"> {% for user in people.experts[:50] %}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 16 23:54:24 GMT 2024 - 8.7K bytes - Viewed (0) -
docs/ja/docs/fastapi-people.md
彼らは、*これまでに* [GitHub issuesで最も多くの人を助けた](help-fastapi.md#github-issues){.internal-link target=_blank}ユーザーです。 多くの人を助けることでexpertsであると示されています。✨ {% if people %} <div class="user-list user-list-center"> {% for user in people.experts[:50] %}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7K bytes - Viewed (0) -
docs/pt/docs/tutorial/query-params-str-validations.md
### Importe `Query` Para isso, primeiro importe `Query` de `fastapi`: ```Python hl_lines="3" {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` ## Use `Query` como o valor padrão Agora utilize-o como valor padrão do seu parâmetro, definindo o parâmetro `max_length` para 50: ```Python hl_lines="9"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 9.3K bytes - Viewed (0) -
docs/ru/docs/tutorial/query-params-str-validations.md
`Union` в `Union[str, None]` позволит редактору кода оказать вам лучшую поддержку и найти ошибки. ## Расширенная валидация Добавим дополнительное условие валидации параметра `q` - **длина строки не более 50 символов** (условие проверяется всякий раз, когда параметр `q` не является `None`). ### Импорт `Query` и `Annotated` Чтобы достичь этого, первым делом нам нужно импортировать: * `Query` из пакета `fastapi`:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 38K bytes - Viewed (0) -
docs/zh/docs/tutorial/query-params-str-validations.md
查询参数 `q` 的类型为 `str`,默认值为 `None`,因此它是可选的。 ## 额外的校验 我们打算添加约束条件:即使 `q` 是可选的,但只要提供了该参数,则该参数值**不能超过50个字符的长度**。 ### 导入 `Query` 为此,首先从 `fastapi` 导入 `Query`: ```Python hl_lines="1" {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` ## 使用 `Query` 作为默认值 现在,将 `Query` 用作查询参数的默认值,并将它的 `max_length` 参数设置为 50: ```Python hl_lines="9" {!../../../docs_src/query_params_str_validations/tutorial002.py!} ```
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)