#NEWLINE# def to_dict( self ) : #NEWLINE# #INDENT# dict_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# dict_info [ 'switches' ] = [ { #NEWLINE# #INDENT# 'switch_ip' : self . switch_ip , #NEWLINE# 'port' : switch_machine . port , #NEWLINE# 'vlans' : switch_machine . vlans , #NEWLINE# #UNINDENT# } for switch_machine in self . switch_machines if ( not switch_machine . filtered ) ] #NEWLINE# if dict_info [ 'switches' ] : #NEWLINE# #INDENT# dict_info . update ( dict_info [ 'switches' ] [ 0 ] ) #NEWLINE# #UNINDENT# dict_info . update ( super ( Machine , self ) . to_dict ( ) ) #NEWLINE# return dict_info