- Sort Score
- Num 10 results
- Language All
Results 41 - 50 of 653 for depende (0.07 seconds)
-
docs/en/docs/reference/dependencies.md
# Dependencies - `Depends()` and `Security()` ## `Depends()` Dependencies are handled mainly with the special function `Depends()` that takes a callable. Here is the reference for it and its parameters. You can import it directly from `fastapi`: ```python from fastapi import Depends ``` ::: fastapi.Depends ## `Security()`
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 671 bytes - Click Count (0) -
docs_src/sql_databases/tutorial002_py39.py
@app.post("/heroes/", response_model=HeroPublic) def create_hero(hero: HeroCreate, session: Session = Depends(get_session)): db_hero = Hero.model_validate(hero) session.add(db_hero) session.commit() session.refresh(db_hero) return db_hero @app.get("/heroes/", response_model=list[HeroPublic]) def read_heroes( session: Session = Depends(get_session), offset: int = 0, limit: int = Query(default=100, le=100), ):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Oct 09 19:44:42 GMT 2024 - 2.6K bytes - Click Count (0) -
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
``` //// //// tab | Python 3.9+ non-Annotated /// tip Prefer to use the `Annotated` version if possible. /// ```Python commons: CommonQueryParams = Depends() ``` //// You declare the dependency as the type of the parameter, and you use `Depends()` without any parameter, instead of having to write the full class *again* inside of `Depends(CommonQueryParams)`.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 6.7K bytes - Click Count (0) -
docs/pt/docs/tutorial/dependencies/classes-as-dependencies.md
``` //// //// tab | Python 3.9+ non-Annotated /// tip | Dica Utilize a versão com `Annotated` se possível. /// ```Python commons: CommonQueryParams = Depends() ``` //// Você declara a dependência como o tipo do parâmetro, e utiliza `Depends()` sem nenhum parâmetro, em vez de ter que escrever a classe *novamente* dentro de `Depends(CommonQueryParams)`.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 7.3K bytes - Click Count (0) -
docs_src/sql_databases/tutorial001_py39.py
def on_startup(): create_db_and_tables() @app.post("/heroes/") def create_hero(hero: Hero, session: Session = Depends(get_session)) -> Hero: session.add(hero) session.commit() session.refresh(hero) return hero @app.get("/heroes/") def read_heroes( session: Session = Depends(get_session), offset: int = 0, limit: int = Query(default=100, le=100), ) -> list[Hero]:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Oct 09 19:44:42 GMT 2024 - 1.8K bytes - Click Count (0) -
docs/changelogs/changelog_4x.md
concurrently close an SSL socket. This would have appeared in crash logs as `NullPointerException: bio == null`. ## Version 4.9.0 _2020-09-11_ **With this release, `okhttp-tls` no longer depends on Bouncy Castle and doesn't install the Bouncy Castle security provider.** If you still need it, you can do it yourself: ``` Security.addProvider(BouncyCastleProvider()) ```Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Apr 17 13:25:31 GMT 2024 - 25.2K bytes - Click Count (0) -
docs_src/security/tutorial004_an_py310.py
async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()], ) -> Token:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Sep 29 02:57:38 GMT 2025 - 4.1K bytes - Click Count (0) -
tests/test_dependency_contextmanager.py
@app.get("/async") async def get_async(state: str = Depends(asyncgen_state)): return state @app.get("/sync") async def get_sync(state: str = Depends(generator_state)): return state @app.get("/async_raise") async def get_async_raise(state: str = Depends(asyncgen_state_try)): assert state == "asyncgen raise started" raise AsyncDependencyError()
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 11.5K bytes - Click Count (0) -
tests/test_ambiguous_params.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 2K bytes - Click Count (1) -
tests/test_repeated_dependency_schema.py
from fastapi import Depends, FastAPI, Header, status from fastapi.testclient import TestClient app = FastAPI() def get_header(*, someheader: str = Header()): return someheader def get_something_else(*, someheader: str = Depends(get_header)): return f"{someheader}123" @app.get("/") def get_deps(dep1: str = Depends(get_header), dep2: str = Depends(get_something_else)): return {"dep1": dep1, "dep2": dep2}
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Mar 06 12:18:57 GMT 2025 - 3.2K bytes - Click Count (0)