Forgive me if this has been answered before, I couldn't find an answer where the validation depended on the aggregate of inline forms.
Little background: I'm doing a site for an insurance broker which has 'Policies' and a 'Total Commission' of that policy. There are also 'Resellers' which are added to the 'Policy' along with a commission which goes to them (can have any number of resellers). The total commission between the resellers has to be less than the total commission.
I have an admin.ModelForm for a policy, and below I have a admin.InlineTabular which can have multiple resellers through the 'Add' button and this all works perfectly.
However, I can't seem to figure out how to do validation on them, so that I can basically add up all the commissions and then if it is greater than the total commission throw a ValidationError.
I've tried clean() but don't know how to access the InlineTabular cleaned data if it is even available!
Thanks in advance for any help!
Thomas