@staticmethod
def _parse_single_filter(key, value):
    """ prepare a value for being used in the api
        """
    import six
    if isinstance(value, six.string_types):
        value = '"%s"' % value
    if value is None:
        value = 'null'
    operator = '='
    tokens = key.split('__')
    key_last_index = None
    if len(tokens) > 1:
        key_last_index = -1
        if tokens[-1] == 'lte':
            operator = '<='
        elif tokens[-1] == 'lt':
            operator = '<'
        elif tokens[-1] == 'gt':
            operator = '>'
        elif tokens[-1] == 'gte':
            operator = '>='
        elif tokens[-1] == 'not':
            operator = '<>'
        else:
            key_last_index = None
    key = '.'.join(tokens[:key_last_index])
    return '{} {} {}'.format(key, operator, value)
