def full_clean(form):

    def add_error(message):
        try:
            form.add_error(None, message)
        except AttributeError:
            form._errors[NON_FIELD_ERRORS] = message

    def all_valid(fieldset):
        cleaned_data = form.cleaned_data
        count = len([i for i in fieldset if cleaned_data.get(i)])
        return (0 < count < len(fieldset))
    super(form.__class__, form).full_clean()
    message = 'Following fields must be together: %s'
    if isinstance(together[0], (list, tuple)):
        for each in together:
            if all_valid(each):
                return add_error((message % ','.join(each)))
    elif all_valid(together):
        return add_error((message % ','.join(together)))
def full_clean(form):

    def add_error(message):
        try:
            form.add_error(None, message)
        except AttributeError:
            form._errors[NON_FIELD_ERRORS] = message

    def all_valid(fieldset):
        cleaned_data = form.cleaned_data
        count = len([i for i in fieldset if cleaned_data.get(i)])
        return (0 < count < len(fieldset))
    super(form.__class__, form).full_clean()
    message = 'Following fields must be together: %s'
    if isinstance(together[0], (list, tuple)):
        for each in together:
            if all_valid(each):
                return add_error((message % ','.join(each)))
    elif all_valid(together):
        return add_error((message % ','.join(together)))