def clean(self):
        count = 0
        for form in self.forms:
            try:
                if form.cleaned_data and not form.cleaned_data.get('DELETE', False):
                    count += 1
            except __HOLE__:
                # annoyingly, if a subform is invalid Django explicity raises
                # an AttributeError for cleaned_data
                pass
        if count < 1:
            raise ValidationError('You must have at least one of these.')
dataset/ETHPy150Open iiilx/django-addressbook/addressbook/forms.py/MandatoryInlineFormSet.clean