#NEWLINE# def _convert_ip_network( self , network , field_name ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return netaddr . IPNetwork ( field_name ) #NEWLINE# #UNINDENT# except ( netaddr . AddrFormatError , ValueError ) : #NEWLINE# #INDENT# msg = _ ( ( '%(field_name)s: Invalid IP address (value=%(network)s)' % dict ( field_name = field_name , network = network ) ) ) #NEWLINE# raise forms . ValidationError ( msg )