(self, domain_name)
:return: A generator of filters each filtering for at most 500 users.
:return: A generator of filters each filtering for at most 500 users.
: return : A generator of filters each filtering for at most 500 users .
def get_filters(self, domain_name):
        """
        :return: A generator of filters each filtering for at most 500 users.
        """
        from corehq.apps.users.dbaccessors import get_all_usernames_by_domain
        if self.usernames:
            usernames = self.usernames
        else:
            usernames = get_all_usernames_by_domain(domain_name)
        for chunk in chunked(usernames, 500):
            filter = Q()
            for username in chunk:
                filter |= Q(username__iexact=username)
            yield filter
def get_filters ( self , domain_name ) : from corehq . apps . users . dbaccessors import get_all_usernames_by_domain if self . usernames : usernames = self . usernames else : usernames = get_all_usernames_by_domain ( domain_name ) for chunk in chunked ( usernames , 500 ) : filter = Q ( ) for username in chunk : filter |= Q ( username__iexact = username ) yield filter