Hi everyone,

In a formset I can use the .clean() method to validate data across the 
formset. The formset.clean() method is run after all the form.clean() 
methods - this makes sense. Raising a formset ValidationError alerts the 
user to the problem with formset.non_form_errors.

I would like to also set an error condition on one of more of the 
individual forms as a result of this formset validation failure to help 
identify the location of the problems (my formsets can be quite long and 
this will help guide the eye). I've spent quite a lot of time looking for 
such an example with no success. Is there a way I can do this?

Here's some pseudo-code to outline what I want to do:

call MyFormSet(BaseFormSet):
    def clean(self):
        super(MyFormSet, self).clean()

        # validation code goes here...

        if some_validation_error:
            raise ValidationError(...)    # creates the formset error 
message

            create_error_in_identified_forms(somehow)    # <<<< I want to 
know how to do this bit

Thanks & best wishes!
R.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ad0683a-9316-44e1-a33b-84d5fa6ec6dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to