#NEWLINE# def product_categories_changed_listener( sender , **kwargs ) : #NEWLINE# #INDENT# instance = kwargs [ 'instance' ] #NEWLINE# reverse = kwargs [ 'reverse' ] #NEWLINE# pk_set = kwargs [ 'pk_set' ] #NEWLINE# if reverse : #NEWLINE# #INDENT# product = instance #NEWLINE# cache_key = ( '%s-product-categories-%s-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , product . id , True ) ) #NEWLINE# cache . delete ( cache_key ) #NEWLINE# cache_key = ( '%s-product-categories-%s-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , product . id , False ) ) #NEWLINE# cache . delete ( cache_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if pk_set : #NEWLINE# #INDENT# for product in Product . objects . filter ( pk__in = pk_set ) : #NEWLINE# #INDENT# cache_key = ( '%s-product-categories-%s-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , product . id , True ) ) #NEWLINE# cache . delete ( cache_key ) #NEWLINE# cache_key = ( '%s-product-categories-%s-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , product . id , False ) ) #NEWLINE# cache . delete ( product )