Decorators
Typed overloads for the marshmallow.decorators
module.
Implements decorators as generic in terms of the decorated method types.
post_load ¶
post_load(
fn: Optional[Callable[..., Any]] = None,
pass_many: bool = False,
pass_original: bool = False,
) -> Callable[..., Any]
Register a method to invoke after deserializing an object.
Typed overload of the original marshmallow.post_load
decorator function.
Generic to ensure that the decorated function retains its type.
Runtime behavior is unchanged.
Receives the deserialized data and returns the processed data.
By default it receives a single object at a time, transparently handling
the many
argument passed to the Schema.load
call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fn |
Optional[Callable[P, R]]
|
The function to decorate or |
None
|
pass_many |
bool
|
If |
False
|
pass_original |
bool
|
If |
False
|
Returns:
Type | Description |
---|---|
Callable[P, R]
|
if |
Callable[[Callable[P, R]], Callable[P, R]]
|
if |