Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for Pasche (0.2 sec)

  1. 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)
  2. 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)
  3. 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)
  4. fastapi/dependencies/utils.py

                continue
            if sub_dependant.use_cache and sub_dependant.cache_key in dependency_cache:
                solved = dependency_cache[sub_dependant.cache_key]
            elif is_gen_callable(call) or is_async_gen_callable(call):
                solved = await solve_generator(
                    call=call, stack=async_exit_stack, sub_values=sub_values
                )
            elif is_coroutine_callable(call):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  5. docs_src/settings/app03_an/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    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
    - 451 bytes
    - Viewed (0)
  6. scripts/docs.py

    import json
    import logging
    import os
    import re
    import shutil
    import subprocess
    from functools import lru_cache
    from http.server import HTTPServer, SimpleHTTPRequestHandler
    from importlib import metadata
    from multiprocessing import Pool
    from pathlib import Path
    from typing import Any, Dict, List, Optional, Union
    
    import mkdocs.commands.build
    import mkdocs.commands.serve
    import mkdocs.config
    import mkdocs.utils
    import typer
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  7. 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)
  8. 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)
  9. 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)
  10. fastapi/utils.py

    from pydantic import BaseModel, create_model
    from pydantic.fields import FieldInfo
    from typing_extensions import Literal
    
    if TYPE_CHECKING:  # pragma: nocover
        from .routing import APIRoute
    
    # Cache for `create_cloned_field`
    _CLONED_TYPES_CACHE: MutableMapping[
        Type[BaseModel], Type[BaseModel]
    ] = WeakKeyDictionary()
    
    
    def is_body_allowed_for_status_code(status_code: Union[int, str, None]) -> bool:
        if status_code is None:
    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)
Back to top