Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 116 for Dependency (0.15 sec)

  1. fastapi/params.py

            )
    
    
    class Depends:
        def __init__(
            self, dependency: Optional[Callable[..., Any]] = None, *, use_cache: bool = True
        ):
            self.dependency = dependency
            self.use_cache = use_cache
    
        def __repr__(self) -> str:
            attr = getattr(self.dependency, "__name__", type(self.dependency).__name__)
            cache = "" if self.use_cache else ", use_cache=False"
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  2. tests/test_tutorial/test_testing_dependencies/test_tutorial001_an_py39.py

    from ...utils import needs_py39
    
    
    @needs_py39
    def test_override_in_items_run():
        from docs_src.dependency_testing.tutorial001_an_py39 import test_override_in_items
    
        test_override_in_items()
    
    
    @needs_py39
    def test_override_in_items_with_q_run():
        from docs_src.dependency_testing.tutorial001_an_py39 import (
            test_override_in_items_with_q,
        )
    
        test_override_in_items_with_q()
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial009.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=Depends(dependency_a)):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b=Depends(dependency_b)):
        dep_c = generate_dep_c()
        try:
            yield dep_c
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 455 bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/dependencies/sub-dependencies.md

        ```Python hl_lines="1"
        async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
            return {"fresh_value": fresh_value}
        ```
    
    === "Python 3.8+ nicht annotiert"
    
        !!! tip "Tipp"
            Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
    
        ```Python hl_lines="1"
        async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:09:48 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  5. tests/test_ws_router.py

        await websocket.send_text(pathparam)
        await websocket.send_text(queryparam)
        await websocket.close()
    
    
    async def ws_dependency():
        return "Socket Dependency"
    
    
    @router.websocket("/router-ws-depends/")
    async def router_ws_decorator_depends(
        websocket: WebSocket, data=Depends(ws_dependency)
    ):
        await websocket.accept()
        await websocket.send_text(data)
        await websocket.close()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. docs/en/docs/reference/background.md

    # Background Tasks - `BackgroundTasks`
    
    You can declare a parameter in a *path operation function* or dependency function with the type `BackgroundTasks`, and then you can use it to schedule the execution of background tasks after the response is sent.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import BackgroundTasks
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 377 bytes
    - Viewed (0)
  7. docs/de/docs/reference/fastapi.md

    ```python
    from fastapi import FastAPI
    ```
    
    ::: fastapi.FastAPI
        options:
            members:
                - openapi_version
                - webhooks
                - state
                - dependency_overrides
                - openapi
                - websocket
                - include_router
                - get
                - put
                - post
                - delete
                - options
                - head
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Feb 18 12:19:32 GMT 2024
    - 715 bytes
    - Viewed (0)
  8. docs/en/docs/reference/request.md

    # `Request` class
    
    You can declare a parameter in a *path operation function* or dependency to be of type `Request` and then you can access the raw request object directly, without any validation, etc.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Request
    ```
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 516 bytes
    - Viewed (0)
  9. docs/en/docs/alternatives.md

    It achieves something somewhat similar to what can be done with Flask-apispec.
    
    It has an integrated dependency injection system, inspired by Angular 2. It requires pre-registering the "injectables" (like all the other dependency injection systems I know), so, it adds to the verbosity and code repetition.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  10. docs/em/docs/advanced/testing-dependencies.md

    ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ” ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ•โ€๐Ÿฆบ, & โš™๏ธ ๐Ÿ›ƒ ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿ“จ ๐ŸŽ ๐Ÿ‘ฉโ€๐Ÿ’ป, ๐Ÿ•ด ๐Ÿ‘† ๐Ÿ’ฏ.
    
    ### โš™๏ธ `app.dependency_overrides` ๐Ÿ”ข
    
    ๐Ÿ‘ซ ๐Ÿ’ผ, ๐Ÿ‘† **FastAPI** ๐Ÿˆธ โœ”๏ธ ๐Ÿ”ข `app.dependency_overrides`, โšซ๏ธ ๐Ÿ™… `dict`.
    
    ๐Ÿ” ๐Ÿ”— ๐Ÿ”ฌ, ๐Ÿ‘† ๐Ÿšฎ ๐Ÿ”‘ โฎ๏ธ ๐Ÿ”— (๐Ÿ”ข), & ๐Ÿ’ฒ, ๐Ÿ‘† ๐Ÿ”— ๐Ÿ” (โž•1๏ธโƒฃ ๐Ÿ”ข).
    
    & โคด๏ธ **FastAPI** ๐Ÿ”œ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ” โ†ฉ๏ธ โฎ๏ธ ๐Ÿ”—.
    
    ```Python hl_lines="28-29  32"
    {!../../../docs_src/dependency_testing/tutorial001.py!}
    ```
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 1.8K bytes
    - Viewed (0)
Back to top