def _get_view_parameter_as_json(self, key = None):
        # change everything to isoformat to prevent error
        dct = {}
        for key in self._get_view_parameter(key):
            value = self._get_view_parameter(key)
            if isinstance(value, DB_Model):
                value = value.to_dict(isoformat = True)
            elif isinstance(value, list):
                new_value = []
                for item in value:
                    if isinstance(item, DB_Model):
                        item = item.to_dict(isoformat = True)
                    elif hasattr(value, 'isoformat'):
                        item = item.isoformat()
                    new_value.append(item)
                value = new_value
            elif hasattr(value, 'isoformat'):
                value = value.isoformat()
            dct[key] = value
        # message should be translated
        if 'message' in dct:
            dct['message'] = self.preprocess_content(dct['message'])
        return json.dumps(dct)
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/controller.py/Crud_Controller._get_view_parameter_as_json/original