#NEWLINE# def get_forms( self ) : #NEWLINE# #INDENT# forms = [ ] #NEWLINE# ipaddresses = self . object . ipaddress_set . all ( ) . values_list ( 'address' , flat = True ) #NEWLINE# if ( not ipaddresses ) : #NEWLINE# #INDENT# return initial #NEWLINE# #UNINDENT# initial = self . dnsaas . get_dns_records ( ipaddresses ) #NEWLINE# for item in initial : #NEWLINE# #INDENT# forms . append ( DNSRecordForm ( item ) ) #NEWLINE# #UNINDENT# if ( initial and ( initial [ 0 ] [ 'type' ] == RecordType . a . id ) ) : #NEWLINE# #INDENT# empty_form = DNSRecordForm ( initial = { #NEWLINE# #INDENT# 'name' : initial [ 0 ] [ 'name' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# empty_form = DNSRecordForm ( ) #NEWLINE# #UNINDENT# forms . append ( empty_form ) #NEWLINE# return forms