'Validates the query content and does the necessary conversions.'

def validate(self, visibility_field):

    if (self.original_query.filter is wtypes.Unset):
        self.filter_expr = None
    else:
        try:
            self.filter_expr = json.loads(self.original_query.filter)
            self._validate_filter(self.filter_expr)
        except (ValueError, jsonschema.exceptions.ValidationError) as e:
            raise base.ClientSideError((_('Filter    expression    not    valid:    %s') % e))
        self._replace_isotime_with_datetime(self.filter_expr)
        self._convert_operator_to_lower_case(self.filter_expr)
        self._normalize_field_names_for_db_model(self.filter_expr)
    self._force_visibility(visibility_field)
    if (self.original_query.orderby is wtypes.Unset):
        self.orderby = None
    else:
        try:
            self.orderby = json.loads(self.original_query.orderby)
            self._validate_orderby(self.orderby)
        except (ValueError, jsonschema.exceptions.ValidationError) as e:
            raise base.ClientSideError((_('Order-by    expression    not    valid:    %s') % e))
        self._convert_orderby_to_lower_case(self.orderby)
        self._normalize_field_names_in_orderby(self.orderby)
    self.limit = (None if (self.original_query.limit is wtypes.Unset) else self.original_query.limit)
    self.limit = v2_utils.enforce_limit(self.limit)
