'Checks if a csv string of IP addresses contains valid values.
If not, raises a ValidationError.'

def _valid_ip_addresses(self, addresses):

    if (addresses == ''):
        return ''
    error_addresses = []
    for addr in addresses.split(','):
        address = addr.strip()
        if (not self._is_valid_ip(address)):
            error_addresses.append(address)
    if error_addresses:
        msg = 'Invalid    IP    Address(es):    {0}'.format(error_addresses)
        msg += '    Please    fix    the    error(s)    and    try    again.'
        raise forms.ValidationError(msg)
    return addresses
