Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for common_parameters (0.16 sec)

  1. tests/test_dependency_overrides.py

    router = APIRouter()
    
    
    async def common_parameters(q: str, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/main-depends/")
    async def main_depends(commons: dict = Depends(common_parameters)):
        return {"in": "main-depends", "params": commons}
    
    
    @app.get("/decorator-depends/", dependencies=[Depends(common_parameters)])
    async def decorator_depends():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/dependencies/index.md

    * Получении результата из вашей функции.
    * Назначении результата в параметр в вашей *функции обработки пути*.
    
    ```mermaid
    graph TB
    
    common_parameters(["common_parameters"])
    read_items["/items/"]
    read_users["/users/"]
    
    common_parameters --> read_items
    common_parameters --> read_users
    ```
    
    Таким образом, вы пишете общий код один раз, и **FastAPI** позаботится о его вызове для ваших *операций с путями*.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/dependencies/index.md

    * Dieses Ergebnis dem Parameter Ihrer *Pfadoperation-Funktion* zuzuweisen.
    
    ```mermaid
    graph TB
    
    common_parameters(["common_parameters"])
    read_items["/items/"]
    read_users["/users/"]
    
    common_parameters --> read_items
    common_parameters --> read_users
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13K bytes
    - Viewed (0)
  4. docs/pt/docs/tutorial/dependencies/index.md

    * Obter o resultado da função.
    * Atribuir esse resultado para o parâmetro em sua *função de operação de rota*.
    
    ```mermaid
    graph TB
    
    common_parameters(["common_parameters"])
    read_items["/items/"]
    read_users["/users/"]
    
    common_parameters --> read_items
    common_parameters --> read_users
    ```
    
    Assim, você escreve um código compartilhado apenas uma vez e o **FastAPI** se encarrega de chamá-lo em suas *operações de rota*.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/dependencies/index.md

    * 올바른 매개변수를 가진 의존성("디펜더블") 함수를 호출합니다.
    * 함수에서 결과를 받아옵니다.
    * *경로 작동 함수*에 있는 매개변수에 그 결과를 할당합니다
    
    ```mermaid
    graph TB
    
    common_parameters(["common_parameters"])
    read_items["/items/"]
    read_users["/users/"]
    
    common_parameters --> read_items
    common_parameters --> read_users
    ```
    
    이렇게 하면 공용 코드를 한번만 적어도 되며, **FastAPI**는 *경로 작동*을 위해 이에 대한 호출을 처리합니다.
    
    /// check | "확인"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/dependencies/classes-as-dependencies.md

    Это относится и к вызываемым объектам без параметров. Работа с ними происходит точно так же, как и для *функций операции пути* без параметров.
    
    Теперь мы можем изменить зависимость `common_parameters`, указанную выше, на класс `CommonQueryParams`:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="11-15"
    {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 16K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/dependencies/classes-as-dependencies.md

    Das gilt auch für Callables ohne Parameter. So wie es auch für *Pfadoperation-Funktionen* ohne Parameter gilt.
    
    Dann können wir das „Dependable“ `common_parameters` der Abhängigkeit von oben in die Klasse `CommonQueryParams` ändern:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="11-15"
    {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/dependencies/classes-as-dependencies.md

    Isso também se aplica a objetos chamáveis que não recebem nenhum parâmetro. Da mesma forma que uma *função de operação de rota* sem parâmetros.
    
    Então, podemos mudar o "injetável" na dependência `common_parameters` acima para a classe `CommonQueryParams`:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="11-15"
    {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
    ```
    
    ////
    
    //// tab | Python 3.9+
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    That also applies to callables with no parameters at all. The same as it would be for *path operation functions* with no parameters.
    
    Then, we can change the dependency "dependable" `common_parameters` from above to the class `CommonQueryParams`:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="11-15"
    {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
    ```
    
    ////
    
    //// tab | Python 3.9+
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.1K bytes
    - Viewed (0)
Back to top