Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 87 for if (0.17 sec)

  1. fastapi/openapi/utils.py

    ) -> Dict[str, Any]:
        info: Dict[str, Any] = {"title": title, "version": version}
        if summary:
            info["summary"] = summary
        if description:
            info["description"] = description
        if terms_of_service:
            info["termsOfService"] = terms_of_service
        if contact:
            info["contact"] = contact
        if license_info:
            info["license"] = license_info
    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)
  2. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

        ```
    
    === "Python 3.10+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="7"
        {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="11"
        {!> ../../../docs_src/dependencies/tutorial001.py!}
        ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  3. fastapi/security/api_key.py

            ] = None,
            auto_error: Annotated[
                bool,
                Doc(
                    """
                    By default, if the query parameter is not provided, `APIKeyQuery` will
                    automatically cancel the request and send the client an error.
    
                    If `auto_error` is set to `False`, when the query parameter is not
                    available, instead of erroring out, the dependency result will be
    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)
  4. docs/en/docs/advanced/settings.md

        If not provided, it's `None` by default, here we provide `"World"` as the default value to use.
    
    Then you could call that Python program:
    
    <div class="termy">
    
    ```console
    // Here we don't set the env var yet
    $ python main.py
    
    // As we didn't set the env var, we get the default value
    
    Hello World from Python
    
    // But if we create an environment variable first
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  5. docs/en/docs/index.md

    * <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Required if you want to use the `TestClient`.
    * <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/wsgi.md

    And the rest will be handled by **FastAPI**.
    
    If you run it with Uvicorn and go to <a href="http://localhost:8000/v1/" class="external-link" target="_blank">http://localhost:8000/v1/</a> you will see the response from Flask:
    
    ```txt
    Hello, World from Flask!
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/sql-databases.md

    ```Python
    current_user.items
    ```
    
    would make SQLAlchemy go to the `items` table and get the items for this user, but not before.
    
    Without `orm_mode`, if you returned a SQLAlchemy model from your *path operation*, it wouldn't include the relationship data.
    
    Even if you declared those relationships in your Pydantic models.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  8. tests/test_jsonable_encoder.py

            raise NotImplementedError()
    
    
    class RoleEnum(Enum):
        admin = "admin"
        normal = "normal"
    
    
    class ModelWithConfig(BaseModel):
        role: Optional[RoleEnum] = None
    
        if PYDANTIC_V2:
            model_config = {"use_enum_values": True}
        else:
    
            class Config:
                use_enum_values = True
    
    
    class ModelWithAlias(BaseModel):
        foo: str = Field(alias="Foo")
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  9. tests/main.py

    
    @app.get("/query/optional")
    def get_query_optional(query=None):
        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    
    @app.get("/query/int")
    def get_query_type(query: int):
        return f"foo bar {query}"
    
    
    @app.get("/query/int/optional")
    def get_query_type_optional(query: Optional[int] = None):
        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/events.md

    You could load it at the top level of the module/file, but that would also mean that it would **load the model** even if you are just running a simple automated test, then that test would be **slow** because it would have to wait for the model to load before being able to run an independent part of the code.
    
    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)
Back to top