#NEWLINE# @ classmethod #NEWLINE# def get_bulk_action_ids( cls , scope , ids , omit_ids = [ ] , query = '' ) : #NEWLINE# #INDENT# '\n        Determine which IDs are to be modified.\n\n        :param scope: Affect all or only a subset of items\n        :type scope: str\n        :param ids: List of ids to be modified\n        :type ids: list\n        :param omit_ids: Remove 1 or more IDs from the list\n        :type omit_ids: list\n        :param query: Search query (if applicable)\n        :type query: str\n        :return: list\n        ' #NEWLINE# omit_ids = map ( str , omit_ids ) #NEWLINE# if ( scope == 'all_search_results' ) : #NEWLINE# #INDENT# ids = cls . query . with_entities ( cls . id ) . filter ( cls . search ( query ) ) #NEWLINE# ids = [ str ( item [ 0 ] ) for item in ids ] #NEWLINE# #UNINDENT# if omit_ids : #NEWLINE# #INDENT# ids = [ id for id in ids if ( id not in omit_ids ) ] #NEWLINE# #UNINDENT# return ids