- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for 50 (0.26 sec)
-
docs/en/docs/tutorial/query-params-str-validations.md
But now, having `Query(max_length=50)` inside of `Annotated`, we are telling FastAPI that we want it to extract this value from the query parameters (this would have been the default anyway 🤷) and that we want to have **additional validation** for this value (that's why we do this, to get the additional validation). 😎 FastAPI will now: * **Validate** the data making sure that the max length is 50 characters
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 25.7K bytes - Viewed (0) -
docs/em/docs/tutorial/query-params-str-validations.md
`Union[str, None]` 🍕 ✔ 👆 👨🎨 🚚 👻 🐕🦺, ✋️ ⚫️ 🚫 ⚫️❔ 💬 FastAPI 👈 👉 🔢 🚫 ✔. ⤴️, 👥 💪 🚶♀️ 🌅 🔢 `Query`. 👉 💼, `max_length` 🔢 👈 ✔ 🎻: ```Python q: Union[str, None] = Query(default=None, max_length=50) ``` 👉 🔜 ✔ 📊, 🎦 🆑 ❌ 🕐❔ 📊 🚫 ☑, & 📄 🔢 🗄 🔗 *➡ 🛠️*. ## 🚮 🌅 🔬 👆 💪 🚮 🔢 `min_length`: === "🐍 3️⃣.6️⃣ & 🔛" ```Python hl_lines="10"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 11.9K 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) -
docs/de/docs/tutorial/query-params-str-validations.md
`Union[str, None]` hingegen erlaubt ihren Editor, Sie besser zu unterstützen und Fehler zu erkennen. ## Zusätzliche Validierung Wir werden bewirken, dass, obwohl `q` optional ist, wenn es gegeben ist, **seine Länge 50 Zeichen nicht überschreitet**. ### `Query` und `Annotated` importieren Importieren Sie zuerst: * `Query` von `fastapi` * `Annotated` von `typing` (oder von `typing_extensions` in Python unter 3.9)
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 17:58:59 GMT 2024 - 27.7K bytes - Viewed (0)