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)
                or isinstance(value, six.binary_type)):
            # Avoid asking the JSON decoder to handle empty values:
            if not value:
                return {}

            try:
                return json.loads(value)
            except __HOLE__:
                logging.getLogger("feincms.contrib.fields").exception(
                    "Unable to deserialize store JSONField data: %s", value)
                return {}
        else:
            assert value is None
            return {}
dataset/ETHPy150Open feincms/feincms/feincms/contrib/fields.py/JSONField.to_python