Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 301 - 310 of 771 for depends (0.04 seconds)

  1. docs_src/dependencies/tutorial003_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
    
    
    class CommonQueryParams:
        def __init__(self, q: str | None = None, skip: int = 0, limit: int = 100):
            self.q = q
            self.skip = skip
            self.limit = limit
    
    
    @app.get("/items/")
    async def read_items(commons=Depends(CommonQueryParams)):
        response = {}
        if commons.q:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 603 bytes
    - Click Count (0)
  2. docs/uk/docs/tutorial/dependencies/index.md

    Хоча ви використовуєте `Depends` у параметрах вашої функції так само, як `Body`, `Query` тощо, `Depends` працює трохи інакше.
    
    Ви передаєте в `Depends` лише один параметр.
    
    Цей параметр має бути чимось на кшталт функції.
    
    Ви її не викликаєте безпосередньо (не додавайте дужки в кінці), ви просто передаєте її як параметр у `Depends()`.
    
    І ця функція приймає параметри так само, як і *функції операцій шляху*.
    
    /// tip | Порада
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 15.1K bytes
    - Click Count (0)
  3. docs/es/docs/advanced/advanced-dependencies.md

    En la versión 0.121.0, FastAPI agregó soporte para `Depends(scope="function")` para dependencias con `yield`.
    
    Usando `Depends(scope="function")`, el código de salida después de `yield` se ejecuta justo después de que la *path operation function* termina, antes de que la response se envíe de vuelta al cliente.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 9.7K bytes
    - Click Count (0)
  4. docs/ru/docs/advanced/security/oauth2-scopes.md

    /// info | Технические детали
    
    `Security` на самом деле является подклассом `Depends` и имеет всего один дополнительный параметр, который мы рассмотрим позже.
    
    Но используя `Security` вместо `Depends`, **FastAPI** будет знать, что можно объявлять security scopes, использовать их внутри и документировать API в OpenAPI.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 20.6K bytes
    - Click Count (0)
  5. docs/es/docs/tutorial/dependencies/sub-dependencies.md

    //// tab | Python 3.10+
    
    ```Python hl_lines="1"
    async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
        return {"fresh_value": fresh_value}
    ```
    
    ////
    
    //// tab | Python 3.10+ sin Anotaciones
    
    /// tip | Consejo
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 13:41:41 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  6. docs_src/dependencies/tutorial008_an_py310.py

    from fastapi import Depends
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 521 bytes
    - Click Count (0)
  7. tests/test_response_change_status_code.py

    from fastapi import Depends, FastAPI, Response
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    async def response_status_setter(response: Response):
        response.status_code = 201
    
    
    async def parent_dep(result=Depends(response_status_setter)):
        return result
    
    
    @app.get("/", dependencies=[Depends(parent_dep)])
    async def get_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 589 bytes
    - Click Count (0)
  8. src/test/java/org/codelibs/fess/job/SuggestJobTest.java

            assertNotNull(suggestJob.sessionId);
            assertEquals(15, suggestJob.sessionId.length());
            // Cache clearing may not always occur in test environment
            // The real behavior depends on the actual SuggestJob implementation
        }
    
        // Test execute method with failure
        @Test
        public void test_execute_failure() {
            createRequiredDirectories();
    
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 31.6K bytes
    - Click Count (0)
  9. docs_src/dependency_testing/tutorial001_py310.py

    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return {"message": "Hello Items!", "params": commons}
    
    
    @app.get("/users/")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.4K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/tutorial/dependencies/index.md

    ///
    
    ### 匯入 `Depends` { #import-depends }
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[3] *}
    
    ### 在「被依賴者」(dependant)中宣告依賴 { #declare-the-dependency-in-the-dependant }
    
    和你在「路徑操作函式」參數上使用 `Body`、`Query` 等方式一樣,針對新參數使用 `Depends`:
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[13,18] *}
    
    雖然你在函式參數上使用 `Depends` 的方式和 `Body`、`Query` 等相同,但 `Depends` 的運作方式有點不同。
    
    你只需要傳給 `Depends` 一個參數。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 8.9K bytes
    - Click Count (0)
Back to Top