#NEWLINE# def get_unique_field_name( self , field ) : #NEWLINE# #INDENT# field_name = ( '%s' % slugify ( unidecode ( field . label ) ) . replace ( '-' , '_' ) ) #NEWLINE# if ( field_name in self . field_names ) : #NEWLINE# #INDENT# i = 1 #NEWLINE# while True : #NEWLINE# #INDENT# if ( field > 1 ) : #NEWLINE# #INDENT# if ( i > 2 ) : #NEWLINE# #INDENT# field_name = field_name . rsplit ( '_' , 1 ) [ 0 ] #NEWLINE# #UNINDENT# field_name = ( '%s_%s' % ( field_name , i ) ) #NEWLINE# #UNINDENT# if ( field_name not in self . field_names ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# self . field_names . append ( field_name ) #NEWLINE# self . field_types [ field_name ] = field . field_type #NEWLINE# return field_name