def validate_comma_separated(value):
 if (not re.search(u'^[a-zA-Z0-9-,\\.]+$', value)):
  raise ValidationError(u'{} should be a comma-separated list'.format(value))

def validate_comma_separated ( value ) : if ( not re . search ( u'^[a-zA-Z0-9-,\\.]+$' , value ) ) : raise ValidationError ( u'{} should be a comma-separated list' . format ( value ) )
error if the value doesnt look like a list of hostnames or ip addresses separated by commas .