Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 418 for annotated (0.14 sec)

  1. docs_src/security/tutorial003_an_py39.py

            )
        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. fastapi/datastructures.py

        ```
        """
    
        file: Annotated[
            BinaryIO,
            Doc("The standard Python file object (non-async)."),
        ]
        filename: Annotated[Optional[str], Doc("The original file name.")]
        size: Annotated[Optional[int], Doc("The size of the file in bytes.")]
        headers: Annotated[Headers, Doc("The headers of the request.")]
        content_type: Annotated[
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial005_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Cookie, Depends, FastAPI
    
    app = FastAPI()
    
    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 529 bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="18"
        {!> ../../../docs_src/dependencies/tutorial006_an.py!}
        ```
    
    === "Python 3.8 без Annotated"
    
        !!! Подсказка
            Рекомендуется использовать версию с Annotated, если возможно.
    
        ```Python hl_lines="17"
        {!> ../../../docs_src/dependencies/tutorial006.py!}
        ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Apr 06 15:43:55 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/request-files.md

        ```
    
    === "Python 3.10+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="7  15"
        {!> ../../../docs_src/request_files/tutorial001_02_py310.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="9  17"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  6. fastapi/openapi/docs.py

    import json
    from typing import Any, Dict, Optional
    
    from fastapi.encoders import jsonable_encoder
    from starlette.responses import HTMLResponse
    from typing_extensions import Annotated, Doc
    
    swagger_ui_default_parameters: Annotated[
        Dict[str, Any],
        Doc(
            """
            Default configurations for Swagger UI.
    
            You can use it as a template to add any other configurations needed.
            """
        ),
    ] = {
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu May 23 22:59:02 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  7. docs_src/dependencies/tutorial005_an.py

    from typing import Union
    
    from fastapi import Cookie, Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 558 bytes
    - Viewed (0)
  8. fastapi/exceptions.py

            return {"item": items[item_id]}
        ```
        """
    
        def __init__(
            self,
            status_code: Annotated[
                int,
                Doc(
                    """
                    HTTP status code to send to the client.
                    """
                ),
            ],
            detail: Annotated[
                Any,
                Doc(
                    """
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="18"
        {!> ../../../docs_src/dependencies/tutorial006_an.py!}
        ```
    
    === "Python 3.8 non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="17"
        {!> ../../../docs_src/dependencies/tutorial006.py!}
        ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat May 18 23:43:13 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  10. docs_src/security/tutorial004_an_py39.py

        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
    ) -> Token:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top