Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the JsonableData data plugin #5017

Merged

Commits on Aug 12, 2021

  1. Add the JsonableData data plugin

    This data plugin is designed to make it easy to wrap instances of
    arbitrary Python classes and store them as a node in the database. The
    only requirement is that the class implements the `as_dict` method,
    which should return a dictionary that represents the instance which is
    JSON-serializable. The latter means that it can be serialized by the
    `JsonEncoder` of the `json` built-in module.
    
    If the class also implements a `from_dict` method, that can consume the
    dictionary that is returned by `as_dict`, to reconstruct an instance,
    the original instance that is wrapped by the node (loaded from the
    database), can be recovered through the `obj` property.
    sphuber committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    9537ef4 View commit details
    Browse the repository at this point in the history