def to_python(self, value):
        """Convert our string value to JSON after we load it from the DB"""

        if isinstance(value, dict):
            return value
        elif isinstance(value, six.string_types):
            # Avoid asking the JSON decoder to handle empty values:
            if not value:
                return {}

            try:
                return json.loads(
                    value, use_decimal=True,
                    object_hook=json_decode_hook)
            except __HOLE__:
                logging.getLogger("plata.fields").exception(
                    "Unable to deserialize stored JSONField data: %s", value)
                return {}
        else:
            assert value is None
            return {}
dataset/ETHPy150Open matthiask/plata/plata/fields.py/JSONField.to_python