Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for Machen (0.21 sec)

  1. tests/test_dependency_cache.py

    ):
        return {"counter": count, "subcounter": subcount}
    
    
    @app.get("/sub-counter-no-cache/")
    async def get_sub_counter_no_cache(
        subcount: int = Depends(super_dep),
        count: int = Depends(dep_counter, use_cache=False),
    ):
        return {"counter": count, "subcounter": subcount}
    
    
    @app.get("/scope-counter")
    async def get_scope_counter(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  2. fastapi/dependencies/models.py

            self.name = name
            self.call = call
            self.use_cache = use_cache
            # Store the path to be able to re-generate a dependable from it in overrides
            self.path = path
            # Save the cache key at creation to optimize performance
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  3. tests/test_params_repr.py

        assert repr(Depends()) == "Depends(NoneType)"
        assert repr(Depends(get_user)) == "Depends(get_user)"
        assert repr(Depends(use_cache=False)) == "Depends(NoneType, use_cache=False)"
        assert (
            repr(Depends(get_user, use_cache=False)) == "Depends(get_user, use_cache=False)"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. docs_src/settings/app02_an_py39/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 445 bytes
    - Viewed (0)
  5. fastapi/utils.py

    ) -> ModelField:
        if PYDANTIC_V2:
            return field
        # cloned_types caches already cloned types to support recursive models and improve
        # performance by avoiding unnecessary cloning
        if cloned_types is None:
            cloned_types = _CLONED_TYPES_CACHE
    
        original_type = field.type_
        if is_dataclass(original_type) and hasattr(original_type, "__pydantic_model__"):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  6. docs_src/settings/app03_an_py39/main.py

    from functools import lru_cache
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 462 bytes
    - Viewed (0)
  7. fastapi/params.py

        ):
            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"
            return f"{self.__class__.__name__}({attr}{cache})"
    
    
    class Security(Depends):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  8. fastapi/param_functions.py

    
        @app.get("/items/")
        async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
            return commons
        ```
        """
        return params.Depends(dependency=dependency, use_cache=use_cache)
    
    
    def Security(  # noqa: N802
        dependency: Annotated[
            Optional[Callable[..., Any]],
            Doc(
                """
                A "dependable" callable (like a function).
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  9. docs_src/settings/app02_an/main.py

    from functools import lru_cache
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 456 bytes
    - Viewed (0)
  10. scripts/mkdocs_hooks.py

    from functools import lru_cache
    from pathlib import Path
    from typing import Any, List, Union
    
    import material
    from mkdocs.config.defaults import MkDocsConfig
    from mkdocs.structure.files import File, Files
    from mkdocs.structure.nav import Link, Navigation, Section
    from mkdocs.structure.pages import Page
    
    non_traslated_sections = [
        "reference/",
        "release-notes.md",
    ]
    
    
    @lru_cache
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 5.1K bytes
    - Viewed (0)
Back to top