Esempio n. 1
0
def Depends(  # noqa: N802
        dependency: Callable = None, *, use_cache: bool = True) -> Any:
    return params.Depends(dependency=dependency, use_cache=use_cache)
Esempio n. 2
0
def Depends(  # noqa: N802
    dependency: Optional[Callable[..., Any]] = None, *, use_cache: bool = True
) -> Any:
    return params.Depends(dependency=dependency, use_cache=use_cache)
Esempio n. 3
0
def get_container() -> params.Depends:
    async def depends_wrapper(request: Request) -> IContainer:
        return request.app.container

    return params.Depends(dependency=depends_wrapper, use_cache=True)
Esempio n. 4
0
def Depends(dependency: Callable = None) -> Any:  # noqa: N802
    return params.Depends(dependency=dependency)
Esempio n. 5
0
def get_all_dependencies(annotation):
    async def depends_wrapper(request: Request):
        return request.app.container.get_all(annotation)

    return params.Depends(dependency=depends_wrapper, use_cache=True)