'Validator, validates a string and converts it into db format'

def __call__(self, value):

    error = (lambda v, e: (v, ('%s:    %s' % (current.T(self.error_message), e))))
    if current.response.s3.bulk:
        import ast
        try:
            value_ = json.dumps(ast.literal_eval(value), separators=SEPARATORS)
        except (JSONERRORS + (SyntaxError,)) as e:
            return error(value, e)
        if self.native_json:
            return (value_, None)
        else:
            return (json.loads(value_), None)
    else:
        try:
            if self.native_json:
                json.loads(value)
                return (value, None)
            else:
                return (json.loads(value), None)
        except JSONERRORS as e:
            return error(value, e)
