You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
When Marshmallow Schema deserializes, the decorator @post_load returns a model with value. We use this model to access some attributes directly:
result=schema.loads()
print(result.attr)
Sometimes, when marshmallow lib version is incompatible with the project marshmallow version, the @post_load returns an UnmarshallResult object instead of the model value.
To fix this, we need to use result.data.attr instead of access directly the model attributes. This is a workaround, but the ideal scenario is @post_load always returns the Model instance.
The text was updated successfully, but these errors were encountered:
When Marshmallow Schema deserializes, the decorator
@post_load
returns a model with value. We use this model to access some attributes directly:Sometimes, when marshmallow lib version is incompatible with the project marshmallow version, the
@post_load
returns an UnmarshallResult object instead of the model value.marshmallow-code/marshmallow#830
To fix this, we need to use
result.data.attr
instead of access directly the model attributes. This is a workaround, but the ideal scenario is@post_load
always returns the Model instance.The text was updated successfully, but these errors were encountered: