- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 534 for Weights (0.04 sec)
-
tests/test_tutorial/test_extra_models/test_tutorial005_py39.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.6K bytes - Viewed (0) -
docs_src/body_nested_models/tutorial009_py39.py
from fastapi import FastAPI app = FastAPI() @app.post("/index-weights/") async def create_index_weights(weights: dict[int, float]):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 154 bytes - Viewed (0) -
tests/test_tutorial/test_extra_models/test_tutorial005.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
data = {"2": 2.2, "3": 3.3} response = client.post("/index-weights/", json=data) assert response.status_code == 200, response.text assert response.json() == data @needs_py39 def test_post_invalid_body(client: TestClient): data = {"foo": 2.2, "3": 3.3} response = client.post("/index-weights/", json=data) assert response.status_code == 422, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 4.3K bytes - Viewed (0) -
tests/test_tutorial/test_body_nested_models/test_tutorial009.py
def test_post_body(client: TestClient): data = {"2": 2.2, "3": 3.3} response = client.post("/index-weights/", json=data) assert response.status_code == 200, response.text assert response.json() == data def test_post_invalid_body(client: TestClient): data = {"foo": 2.2, "3": 3.3} response = client.post("/index-weights/", json=data) assert response.status_code == 422, response.text assert response.json() == IsDict(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 4.2K bytes - Viewed (0) -
docs_src/extra_models/tutorial005_py39.py
from fastapi import FastAPI app = FastAPI() @app.get("/keyword-weights/", response_model=dict[str, float]) async def read_keyword_weights():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 180 bytes - Viewed (0) -
docs/de/docs/tutorial/body-nested-models.md
Das bedeutet, dass Ihre API-Clients nur Strings senden können, aber solange diese Strings nur Zahlen enthalten, wird Pydantic sie konvertieren und validieren. Und das `dict` welches Sie als `weights` erhalten, wird `int`-Schlüssel und `float`-Werte haben. /// ## Zusammenfassung Mit **FastAPI** haben Sie die maximale Flexibilität von Pydantic-Modellen, während Ihr Code einfach, kurz und elegant bleibt.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.3K bytes - Viewed (0) -
docs/pt/docs/tutorial/body-nested-models.md
Isso significa que, embora os clientes da API só possam enviar strings como chaves, desde que essas strings contenham inteiros puros, o Pydantic irá convertê-los e validá-los. E o `dict` que você recebe como `weights` terá, na verdade, chaves `int` e valores` float`. /// ## Recapitulação Com **FastAPI** você tem a flexibilidade máxima fornecida pelos modelos Pydantic, enquanto seu código é mantido simples, curto e elegante.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.4K bytes - Viewed (0) -
docs/em/docs/tutorial/body-nested-models.md
//// /// tip ✔️ 🤯 👈 🎻 🕴 🐕🦺 `str` 🔑. ✋️ Pydantic ✔️ 🏧 💽 🛠️. 👉 ⛓ 👈, ✋️ 👆 🛠️ 👩💻 💪 🕴 📨 🎻 🔑, 📏 👈 🎻 🔌 😁 🔢, Pydantic 🔜 🗜 👫 & ✔ 👫. & `dict` 👆 📨 `weights` 🔜 🤙 ✔️ `int` 🔑 & `float` 💲. /// ## 🌃 ⏮️ **FastAPI** 👆 ✔️ 🔆 💪 🚚 Pydantic 🏷, ⏪ 🚧 👆 📟 🙅, 📏 & 😍. ✋️ ⏮️ 🌐 💰: * 👨🎨 🐕🦺 (🛠️ 🌐 ❗) * 💽 🛠️ (.Ⓜ.. ✍ / 🛠️)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.1K bytes - Viewed (0) -
docs/ru/docs/tutorial/body-nested-models.md
Это значит, что даже если пользователи вашего API могут отправлять только строки в качестве ключей, при условии, что эти строки содержат целые числа, Pydantic автоматический преобразует и валидирует эти данные. А `dict`, с именем `weights`, который вы получите в качестве ответа Pydantic, действительно будет иметь ключи типа `int` и значения типа `float`. /// ## Резюме
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 14.8K bytes - Viewed (0)