- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 29 for def (0.04 sec)
-
tests/test_multipart_installation.py
with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(username: str = Form()): return username # pragma: nocover def test_incorrect_multipart_installed_file_upload(monkeypatch): monkeypatch.setattr("python_multipart.__version__", "0.0.12") with warnings.catch_warnings(record=True):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 21:46:26 UTC 2024 - 5.7K bytes - Viewed (0) -
fastapi/security/oauth2.py
```python from typing import Annotated from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordRequestForm app = FastAPI() @app.post("/login") def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]): data = {} data["scopes"] = [] for scope in form_data.scopes: data["scopes"].append(scope) if form_data.client_id:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 23 18:30:18 UTC 2024 - 21.1K bytes - Viewed (0) -
docs/de/docs/advanced/async-tests.md
## HTTPX Auch wenn Ihre **FastAPI**-Anwendung normale `def`-Funktionen anstelle von `async def` verwendet, handelt es sich darunter immer noch um eine `async`hrone Anwendung.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 15:34:47 UTC 2024 - 4.3K bytes - Viewed (0) -
docs/en/docs/advanced/async-tests.md
## HTTPX Even if your **FastAPI** application uses normal `def` functions instead of `async def`, it is still an `async` application underneath.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 15:43:29 UTC 2024 - 3.8K bytes - Viewed (0) -
fastapi/dependencies/utils.py
security_scopes=security_scopes, ) def get_parameterless_sub_dependant(*, depends: params.Depends, path: str) -> Dependant: assert callable( depends.dependency ), "A parameter-less dependency must have a callable dependency" return get_sub_dependant(depends=depends, dependency=depends.dependency, path=path) def get_sub_dependant( *, depends: params.Depends,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 21:46:26 UTC 2024 - 34.7K bytes - Viewed (0) -
docs/pt/docs/advanced/dataclasses.md
Novamente, você pode combinar `dataclasses` com anotações de tipo padrão. 8. Note que esta *função de operação de rota* usa `def` regular em vez de `async def`. Como sempre, no FastAPI você pode combinar `def` e `async def` conforme necessário.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Oct 22 17:33:53 UTC 2024 - 4.4K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java
assertEquals( "getOrDefault(null, def) should return the default value", v3(), getMap().getOrDefault(null, v3())); } @MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES) public void testGetOrDefault_nullAbsentAndUnsupported() { try { assertEquals( "getOrDefault(null, def) should return default or throw", v3(),
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 31 14:51:04 UTC 2024 - 4.5K bytes - Viewed (0) -
docs/fr/docs/tutorial/background-tasks.md
Elle peut être une fonction asynchrone (`async def`) ou une fonction normale (`def`), **FastAPI** saura la gérer correctement. Dans cet exemple, la fonction de tâche écrira dans un fichier (afin de simuler un envoi d'email). L'opération d'écriture n'utilisant ni `async` ni `await`, on définit la fonction avec un `def` normal. {* ../../docs_src/background_tasks/tutorial001.py hl[6:9] *}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Oct 28 10:29:51 UTC 2024 - 5.6K bytes - Viewed (0) -
docs/en/docs/advanced/events.md
You can define event handlers (functions) that need to be executed before the application starts up, or when the application is shutting down. These functions can be declared with `async def` or normal `def`. ### `startup` event To add a function that should be run before the application starts, declare it with the event `"startup"`: {* ../../docs_src/events/tutorial001.py hl[8] *}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Oct 28 10:36:22 UTC 2024 - 7.6K bytes - Viewed (0) -
docs/en/docs/tutorial/dependencies/index.md
You can use `async def` or normal `def`. And you can declare dependencies with `async def` inside of normal `def` *path operation functions*, or `def` dependencies inside of `async def` *path operation functions*, etc. It doesn't matter. **FastAPI** will know what to do. /// note
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Oct 28 11:18:17 UTC 2024 - 9.2K bytes - Viewed (0)