#NEWLINE# def get_parents( self ) : #NEWLINE# #INDENT# '\n        Returns all parent categories.\n        ' #NEWLINE# cache_key = ( '%s-category-parents-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , self . id ) ) #NEWLINE# parents = cache . get ( cache_key ) #NEWLINE# if ( parents is not None ) : #NEWLINE# #INDENT# return parents #NEWLINE# #UNINDENT# parents = [ ] #NEWLINE# category = self . parent #NEWLINE# while ( category is not None ) : #NEWLINE# #INDENT# parents . append ( category ) #NEWLINE# category = category . parent #NEWLINE# #UNINDENT# cache . set ( cache_key , parents ) #NEWLINE# return parents