#NEWLINE# def services( self , request , pk = None ) : #NEWLINE# #INDENT# settings = models . ServiceSettings . objects . get ( id = pk ) #NEWLINE# projects = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , model ) in SupportedServices . get_service_models ( ) . items ( ) : #NEWLINE# #INDENT# if ( name == SupportedServices . Types . IaaS ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# services = model [ 'service' ] . objects . filter ( settings = settings ) . values_list ( 'id' , flat = True ) #NEWLINE# for spl in model [ 'service_project_link' ] . objects . filter ( service__in = services ) : #NEWLINE# #INDENT# projects . setdefault ( spl . project . id , { #NEWLINE# #INDENT# 'name' : six . text_type ( spl . project ) , #NEWLINE# 'url' : get_admin_url ( spl . project ) , #NEWLINE# 'services' : [ ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# projects [ spl . project . id ] [ 'services' ] . append ( { #NEWLINE# #INDENT# 'name' : six . text_type ( spl . service ) , #NEWLINE# 'url' : get_admin_url ( spl . service ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return render ( request , 'structure/service_settings_entities.html' , { #NEWLINE# #INDENT# 'projects' : projects . values ( ) , #NEWLINE# #UNINDENT# } )