views:

23

answers:

1

Exactly like this question, except that one got closed and accepted without a real answer. It looks like I can use a custom formset and override the clean method, but that still doesn't answer how I check that they're all filled in. What properties am I supposed to be looking at?

The formset is smart enough to ignore extra forms that were not changed.

*Screams* This has caused me nothing but agony.

A: 

Think I found the solution by digging through the source...

class BaseVehicleFormSet(BaseFormSet):
    def clean(self):
        for i in range(self.total_form_count()):
            if not self.forms[i].has_changed():
                raise ValidationError("All vehicle forms must be filled in. Press \"remove\" if you've added too many.")
Mark