Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for rubyclass (0.24 sec)

  1. docs/en/docs/how-to/custom-request-and-route.md

    * Decompressing gzip-compressed request bodies.
    * Automatically logging all request bodies.
    
    ## Handling custom request body encodings
    
    Let's see how to make use of a custom `Request` subclass to decompress gzip requests.
    
    And an `APIRoute` subclass to use that custom request class.
    
    ### Create a custom `GzipRequest` class
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  2. docs/en/docs/how-to/nosql-databases-couchbase.md

    ### `UserInDB` model
    
    Now, let's create a `UserInDB` model.
    
    This will have the data that is actually stored in the database.
    
    We don't create it as a subclass of Pydantic's `BaseModel` but as a subclass of our own `User`, because it will have all the attributes in `User` plus a couple more:
    
    ```Python hl_lines="31-33"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    !!! note
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  3. docs/en/docs/release-notes.md

    avoids/fixes a potential security issue: as the returned object is passed directly to Pydantic, if the returned object was a subclass of the `response_model` (e.g. you return a `UserInDB` that inherits from `User` but contains extra fields, like `hashed_password`, and `User` is used in the `response_model`), it would still pass the validation (because `UserInDB` is a subclass of `User`) and the object would be returned as-is, including the `hashed_password`. To fix this, the declared `response_model`...
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
  4. tests/test_jsonable_encoder.py

            pass
    
        model = ModelWithCustomEncoder(dt_field=datetime(2019, 1, 1, 8))
        assert jsonable_encoder(model) == {"dt_field": "2019-01-01T08:00:00+00:00"}
        subclass_model = ModelWithCustomEncoderSubclass(dt_field=datetime(2019, 1, 1, 8))
        assert jsonable_encoder(subclass_model) == {"dt_field": "2019-01-01T08:00:00+00:00"}
    
    
    # TODO: remove when deprecating Pydantic v1
    @needs_pydanticv1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/body-fields.md

    !!! note "Technical Details"
        Actually, `Query`, `Path` and others you'll see next create objects of subclasses of a common `Param` class, which is itself a subclass of Pydantic's `FieldInfo` class.
    
        And Pydantic's `Field` returns an instance of `FieldInfo` as well.
    
        `Body` also returns objects of a subclass of `FieldInfo` directly. And there are others you will see later that are subclasses of the `Body` class.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/response-model.md

    This simple case is handled automatically by FastAPI because the return type annotation is the class (or a subclass) of `Response`.
    
    And tools will also be happy because both `RedirectResponse` and `JSONResponse` are subclasses of `Response`, so the type annotation is correct.
    
    ### Annotate a Response Subclass
    
    You can also use a subclass of `Response` in the type annotation:
    
    ```Python hl_lines="8-9"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/security/oauth2-scopes.md

        ```Python hl_lines="4  139  168"
        {!> ../../../docs_src/security/tutorial005.py!}
        ```
    
    !!! info "Technical Details"
        `Security` is actually a subclass of `Depends`, and it has just one extra parameter that we'll see later.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  8. fastapi/routing.py

                # as is just because it's an instance of a subclass of a more limited class
                # e.g. UserInDB (containing hashed_password) could be a subclass of User
                # that doesn't have the hashed_password. But because it's a subclass, it
                # would pass the validation and be returned as is.
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
Back to top