def iterable(self, iterable_name, *, collection, attribute, word, func=None,
                 operation=None):
        """ Performs a filter with the OData 'iterable_name' keyword
        on the collection

        For example:
        q.iterable('any', collection='email_addresses', attribute='address',
        operation='eq', word='george@best.com')

        will transform to a filter such as:
        emailAddresses/any(a:a/address eq 'george@best.com')

        :param str iterable_name: the OData name of the iterable
        :param str collection: the collection to apply the any keyword on
        :param str attribute: the attribute of the collection to check
        :param str word: the word to check
        :param str func: the logical function to apply to the attribute inside
         the collection
        :param str operation: the logical operation to apply to the attribute
         inside the collection
        :rtype: Query
        """

        if func is None and operation is None:
            raise ValueError('Provide a function or an operation to apply')
        elif func is not None and operation is not None:
            raise ValueError(
                'Provide either a function or an operation but not both')

        current_att = self._attribute
        self._attribute = iterable_name

        word = self._parse_filter_word(word)
        collection = self._get_mapping(collection)
        attribute = self._get_mapping(attribute)

        if func is not None:
            sentence = self._prepare_function(func, attribute, word)
        else:
            sentence = self._prepare_sentence(attribute, operation, word)

        filter_str, attrs = sentence

        filter_data = '{}/{}(a:a/{})'.format(collection, iterable_name, filter_str), attrs
        self._add_filter(*filter_data)

        self._attribute = current_att

        return self
def iterable ( self , iterable_name , * , collection , attribute , word , func = None , operation = None ) : if func is None and operation is None : raise ValueError ( 'Provide a function or an operation to apply' ) elif func is not None and operation is not None : raise ValueError ( 'Provide either a function or an operation but not both' ) current_att = self . _attribute self . _attribute = iterable_name word = self . _parse_filter_word ( word ) collection = self . _get_mapping ( collection ) attribute = self . _get_mapping ( attribute ) if func is not None : sentence = self . _prepare_function ( func , attribute , word ) else : sentence = self . _prepare_sentence ( attribute , operation , word ) filter_str , attrs = sentence filter_data = '{}/{}(a:a/{})' . format ( collection , iterable_name , filter_str ) , attrs self . _add_filter ( * filter_data ) self . _attribute = current_att return self
Performs a filter with the OData 'iterable_name' keyword
        on the collection

        For example:
        q.iterable('any', collection='email_addresses', attribute='address',
        operation='eq', word='george@best.com')

        will transform to a filter such as:
        emailAddresses/any(a:a/address eq 'george@best.com')

        :param str iterable_name: the OData name of the iterable
        :param str collection: the collection to apply the any keyword on
        :param str attribute: the attribute of the collection to check
        :param str word: the word to check
        :param str func: the logical function to apply to the attribute inside
         the collection
        :param str operation: the logical operation to apply to the attribute
         inside the collection
        :rtype: Query