#NEWLINE# def cache_flag( **kwargs ) : #NEWLINE# #INDENT# action = kwargs . get ( 'action' , None ) #NEWLINE# if ( ( not action ) or ( action in [ 'post_add' , 'post_remove' , 'post_clear' ] ) ) : #NEWLINE# #INDENT# f = kwargs . get ( 'instance' ) #NEWLINE# cache . add ( keyfmt ( get_setting ( 'FLAG_CACHE_KEY' ) , f . name ) , f ) #NEWLINE# cache . add ( keyfmt ( get_setting ( 'FLAG_USERS_CACHE_KEY' ) , f . name ) , f . users . all ( ) ) #NEWLINE# cache . add ( keyfmt ( get_setting ( 'FLAG_GROUPS_CACHE_KEY' ) , f . name ) , f . groups . all ( ) )