Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 142 for or (0.37 sec)

  1. docs_src/dependencies/tutorial005_an.py

        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(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 558 bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ### Always `raise` in Dependencies with `yield` and `except`
    
    If you catch an exception in a dependency with `yield`, unless you are raising another `HTTPException` or similar, you should re-raise the original exception.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/events.md

        You can probably skip this part.
    
    There's an alternative way to define this logic to be executed during *startup* and during *shutdown*.
    
    You can define event handlers (functions) that need to be executed before the application starts up, or when the application is shutting down.
    
    These functions can be declared with `async def` or normal `def`.
    
    ### `startup` event
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/path-params-numeric-validations.md

        So, you should declare it with `...` to mark it as required.
    
        Nevertheless, even if you declared it with `None` or set a default value, it would not affect anything, it would still be always required.
    
    ## Order the parameters as you need
    
    !!! tip
        This is probably not as important or necessary if you use `Annotated`.
    
    Let's say that you want to declare the query parameter `q` as a required `str`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  5. fastapi/security/api_key.py

                    parameter or in an HTTP Bearer token).
                    """
                ),
            ] = True,
        ):
            self.model: APIKey = APIKey(
                **{"in": APIKeyIn.query},  # type: ignore[arg-type]
                name=name,
                description=description,
            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 23 22:29:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  6. docs/en/docs/reference/response.md

    # `Response` class
    
    You can declare a parameter in a *path operation function* or dependency to be of type `Response` and then you can set data for the response like headers or cookies.
    
    You can also use it directly to create an instance of it and return it from your *path operations*.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Response
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 397 bytes
    - Viewed (0)
  7. fastapi/openapi/utils.py

                            str(additional_status_code).upper()
                        ) or http.client.responses.get(int(additional_status_code))
                        description = (
                            process_response.get("description")
                            or openapi_response.get("description")
                            or status_text
                            or "Additional Response"
                        )
    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. .github/workflows/issue-manager.yml

                {
                  "answered": {
                    "delay": 864000,
                    "message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
                  },
                  "changes-requested": {
                    "delay": 2628000,
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 30 18:46:56 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  9. docs/en/docs/deployment/index.md

    For a **web API**, it normally involves putting it in a **remote machine**, with a **server program** that provides good performance, stability, etc, so that your **users** can **access** the application efficiently and without interruptions or problems.
    
    This is in contrast to the **development** stages, where you are constantly changing the code, breaking it and fixing it, stopping and restarting the development server, etc.
    
    ## Deployment Strategies
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  10. fastapi/dependencies/utils.py

                # `tests/test_infer_param_optionality.py` for an example.
                field_info = params.Path(annotation=use_annotation)
            elif is_uploadfile_or_nonable_uploadfile_annotation(
                type_annotation
            ) or is_uploadfile_sequence_annotation(type_annotation):
                field_info = params.File(annotation=use_annotation, default=default_value)
    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)
Back to top