How to use the marshmallow.post_load function in marshmallow

To help you get started, we’ve selected a few marshmallow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flowminder / FlowKit / flowmachine / flowmachine / core / server / query_schemas / custom_fields.py View on Github external
    @post_load
    def to_tuple(self, params, **kwargs):
        return params["lower_bound"], params["upper_bound"]
github facultyai / faculty / faculty / clients / experiment.py View on Github external
    @post_load
    def make_pagination(self, data):
        return Pagination(**data)
github karma0 / nombot / nombot / generics / request.py View on Github external
    @post_load
    def make_request(self, data):
        """Parse the outgoing schema"""
        callname = self.context.get("callname")
        try:
            payload = REQUEST_MAP[callname].dump(data)  # type: ignore
        except AttributeError:
            payload = None

        request = {
            "callname": callname,
            "payload": payload
        }
        return Request(**request)
github labd / commercetools-python-sdk / src / commercetools / schemas / _order_edit.py View on Github external
    @marshmallow.post_load
    def post_load(self, data, **kwargs):
        del data["action"]
        return types.StagedOrderSetDeliveryItemsAction(**data)
github galterlibrary / InvenioRDM-at-NU / cd2h_repo_project / modules / records / marshmallow / json.py View on Github external
    @post_load
    def remove_envelope(self, data):
        """Post process data."""
        # Remove envelope
        if 'metadata' in data:
            data = data['metadata']

        # Artificially insert our schema because invenio-deposit wants it.
        # TODO: Replace cd2hrepo... by configuration variable
        data['$schema'] = (
            'https://cd2hrepo.galter.northwestern.edu/'
            'schemas/records/record-v0.1.0.json'
        )

        return data
github shiyanlou / louplus-python / taobei / tbuser / models / user.py View on Github external
    @post_load
    def make_user(self, data):
        return User(**data)
github facultyai / faculty / faculty / clients / experiment.py View on Github external
    @post_load
    def make_experiment_run(self, data):
        return ExperimentRun(**data)
github floydhub / floyd-cli / floyd / model / credentials.py View on Github external
    @post_load
    def make_credentials(self, data):
        return Credentials(**data)
github floydhub / floyd-cli / floyd / model / resource.py View on Github external
    @post_load
    def make_resource(self, data):
        return Resource(**data)