#NEWLINE# def get_sla( self , resource ) : #NEWLINE# #INDENT# if ( not hasattr ( self , 'sla_map_cache' ) ) : #NEWLINE# #INDENT# self . sla_map_cache = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# request = self . context [ 'request' ] #NEWLINE# items = ResourceSla . objects . filter ( scope__in = to_list ( self . instance ) ) #NEWLINE# items = items . filter ( period = get_period ( request ) ) #NEWLINE# for item in items : #NEWLINE# #INDENT# self . sla_map_cache [ item . object_id ] = dict ( value = item . value , agreed_value = item . agreed_value , period = item . period ) #NEWLINE# #UNINDENT# #UNINDENT# return self . sla_map_cache . get ( resource . id )