'Convert a string to a numeric type (float or int).
Return None if `s` is empty.
Raise an InvalidQueryError if the string cannot be converted.'

def _convert(self, s):

    if (not s):
        return None
    try:
        return int(s)
    except ValueError:
        try:
            return float(s)
        except ValueError:
            raise InvalidQueryArgumentTypeError(s, u'an    int    or    a    float')
