def get_case_owner_filters(domains): mobile_user_ids = list(get_user_ids(True, domains)) group_query = GroupES() if domains: group_query = group_query.domain(domains) group_ids = group_query.get_ids() return filters.term('owner_id', mobile_user_ids + group_ids)
def filter_context(self): return { "initial_value": self.get_value(self.request, self.domain), "groups": [{ '_id': '', 'name': '' }] + GroupES().domain(self.domain).source(['_id', 'name']).run().hits, }
def get_users_by_group_filter(self, group_ids): return GroupES().domain(self.domain).group_ids(group_ids).values_list( "users", flat=True)