Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for general (0.17 sec)

  1. docs_src/dependencies/tutorial009.py

    
    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
        finally:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 455 bytes
    - Viewed (0)
  2. docs_src/custom_response/tutorial004.py

    from fastapi import FastAPI
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    def generate_html_response():
        html_content = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
        return HTMLResponse(content=html_content, status_code=200)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 491 bytes
    - Viewed (0)
  3. fastapi/dependencies/models.py

            self.security_scopes_param_name = security_scopes_param_name
            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)
  4. .github/actions/notify-translations/app/main.py

        if not langs or lang_all_label not in label_strs:
            logging.info(f"PR #{pr.number} doesn't seem to be a translation PR, skipping")
            sys.exit(0)
    
        # Generate translation map, lang ID to discussion
        discussions = get_graphql_translation_discussions(settings=settings)
        lang_to_discussion_map: Dict[str, AllDiscussionsDiscussionNode] = {}
        for discussion in discussions:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008_an.py

    from fastapi import Depends
    from typing_extensions import Annotated
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 531 bytes
    - Viewed (0)
  6. scripts/docs.py

        new_content = pre_content + message + post_content
        return new_content
    
    
    @app.command()
    def generate_readme() -> None:
        """
        Generate README.md content from main index.md
        """
        typer.echo("Generating README")
        readme_path = Path("README.md")
        new_content = generate_readme_content()
        readme_path.write_text(new_content, encoding="utf-8")
    
    
    @app.command()
    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. fastapi/openapi/utils.py

        request_body_oai["content"] = {request_media_type: request_media_content}
        return request_body_oai
    
    
    def generate_operation_id(
        *, route: routing.APIRoute, method: str
    ) -> str:  # pragma: nocover
        warnings.warn(
            "fastapi.openapi.utils.generate_operation_id() was deprecated, "
            "it is not used internally, and will be removed soon",
            DeprecationWarning,
            stacklevel=2,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_generate_clients/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.generate_clients.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_post_items():
        response = client.post("/items/", json={"name": "Foo", "price": 5})
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Item received"}
    
    
    def test_post_users():
        response = client.post(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  9. fastapi/_compat.py

                with_info_plain_validator_function as with_info_plain_validator_function,
            )
        except ImportError:  # pragma: no cover
            from pydantic_core.core_schema import (
                general_plain_validator_function as with_info_plain_validator_function,  # noqa: F401
            )
    
        Required = PydanticUndefined
        Undefined = PydanticUndefined
        UndefinedType = PydanticUndefinedType
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  10. fastapi/param_functions.py

                """
            ),
        ] = ...,
        *,
        default_factory: Annotated[
            Union[Callable[[], Any], None],
            Doc(
                """
                A callable to generate the default value.
    
                This doesn't affect `Path` parameters as the value is always required.
                The parameter is available only for compatibility.
                """
            ),
        ] = _Unset,
    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)
Back to top