#NEWLINE# def _get_forum_ancestors_ids( self , forum ) : #NEWLINE# #INDENT# '\n        Returns the ancestor IDs of the given forum. These parent forum identifiers are\n        stored inside a local cache for further use.\n        ' #NEWLINE# forum_ancestors_cache_key = '{}__ancestors' . format ( forum . pk ) #NEWLINE# if ( forum_ancestors_cache_key in self . _forum_ancestors_cache ) : #NEWLINE# #INDENT# return self . _forum_ancestors_cache [ forum_ancestors_cache_key ] #NEWLINE# #UNINDENT# forum_ancestor_ids = list ( forum . get_ancestors ( ) . values_list ( 'id' , flat = True ) ) #NEWLINE# self . _forum_ancestors_cache [ forum_ancestors_cache_key ] = forum_ancestor_ids #NEWLINE# return forum_ancestors_cache_key