Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for instance (0.24 sec)

  1. tests/test_jsonable_encoder.py

            pass
    
        class MyModel(BaseModel):
            dt_field: safe_datetime
    
        instance = MyModel(dt_field=safe_datetime.now())
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.isoformat()}
        )
        assert encoded_instance["dt_field"] == instance.dt_field.isoformat()
    
    
    def test_custom_enum_encoders():
        def custom_enum_encoder(v: Enum):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  2. fastapi/security/api_key.py

        the key value sent in the query parameter automatically and provides it as the
        dependency result. But it doesn't define how to send that API key to the client.
    
        ## Usage
    
        Create an instance object and use that object as the dependency in `Depends()`.
    
        The dependency result will be a string containing the key value.
    
        ## Example
    
        ```python
        from fastapi import Depends, FastAPI
    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)
  3. fastapi/encoders.py

                for encoder_type, encoder_instance in custom_encoder.items():
                    if isinstance(obj, encoder_type):
                        return encoder_instance(obj)
        if include is not None and not isinstance(include, (set, dict)):
            include = set(include)
        if exclude is not None and not isinstance(exclude, (set, dict)):
            exclude = set(exclude)
        if isinstance(obj, BaseModel):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  4. fastapi/security/open_id_connect_url.py

    from starlette.requests import Request
    from starlette.status import HTTP_403_FORBIDDEN
    from typing_extensions import Annotated, Doc
    
    
    class OpenIdConnect(SecurityBase):
        """
        OpenID Connect authentication class. An instance of it would be used as a
        dependency.
        """
    
        def __init__(
            self,
            *,
            openIdConnectUrl: Annotated[
                str,
                Doc(
                    """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  5. docs/sts/client_grants/sts_element.py

    _STS_NS = {'sts': 'https://sts.amazonaws.com/doc/2011-06-15/'}
    
    
    class STSElement(object):
        """STS aware XML parsing class. Wraps a root element name and
        cElementTree.Element instance. Provides STS namespace aware parsing
        functions.
    
        """
    
        def __init__(self, root_name, element):
            self.root_name = root_name
            self.element = element
    
        @classmethod
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  6. fastapi/security/http.py

            return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)
    
    
    class HTTPBasic(HTTPBase):
        """
        HTTP Basic authentication.
    
        ## Usage
    
        Create an instance object and use that object as the dependency in `Depends()`.
    
        The dependency result will be an `HTTPBasicCredentials` object containing the
        `username` and the `password`.
    
        Read more about it in the
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. fastapi/security/oauth2.py

                scope=scope,
                client_id=client_id,
                client_secret=client_secret,
            )
    
    
    class OAuth2(SecurityBase):
        """
        This is the base class for OAuth2 authentication, an instance of it would be used
        as a dependency. All other OAuth2 classes inherit from it and customize it for
        each OAuth2 flow.
    
        You normally would not create a new class inheriting from it but use one of the
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  8. configure.py

      """Add default build and test flags required for TF tests to bazelrc."""
      write_to_bazelrc('test --test_size_filters=small,medium')
    
      # Each instance of --test_tag_filters or --build_tag_filters overrides all
      # previous instances, so we need to build up a complete list and write a
      # single list of filters for the .bazelrc file.
    
      # Filters to use with both --test_tag_filters and --build_tag_filters
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  9. fastapi/applications.py

                    This is simply inherited from Starlette.
    
                    Read more about it in the
                    [Starlette docs for Applications](https://www.starlette.io/applications/#storing-state-on-the-app-instance).
                    """
                ),
            ] = State()
            self.dependency_overrides: Annotated[
                Dict[Callable[..., Any], Callable[..., Any]],
                Doc(
                    """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  10. docs_src/path_operation_advanced_configuration/tutorial002.py

        """
        Simplify operation IDs so that generated API clients have simpler function
        names.
    
        Should be called only after all routes have been added.
        """
        for route in app.routes:
            if isinstance(route, APIRoute):
                route.operation_id = route.name  # in this case, 'read_items'
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 572 bytes
    - Viewed (0)
Back to top