2009/4/8 brian <bbiermans...@gmail.com>:
>
> I think I'm having the same issue.  Did you ever find a solution?
>

Yea, Karen Tracey was right in my case:

> On Feb 14, 5:06 pm, Karen Tracey <kmtra...@gmail.com> wrote:
>> On Sat, Feb 14, 2009 at 11:07 AM, Alistair Marshall <
>> this is covered here:
>>
>> http://docs.djangoproject.com/en/dev/ref/forms/validation/
>>
>> where it states:
>>
>> As mentioned, any of these methods can raise a ValidationError. For any
>> field, if the Field.clean() method raises a ValidationError, any
>> field-specific cleaning method is not called. However, the cleaning methods
>> for all remaining fields are still executed.
>>
>> The clean() method for the Form class or subclass is always run. If that
>> method raises a ValidationError, cleaned_data will be an empty dictionary.
>>
>> The previous paragraph means that if you are overriding Form.clean(), you
>> should iterate through self.cleaned_data.items(), possibly considering the
>> _errors dictionary attribute on the form as well. In this way, you will
>> already know which fields have passed their individual validation
>> requirements.
>>
>> The idea is to get all the problems identified, as far as possible, and not
>> let the first error encountered stop the process.  That way (hopefully) all
>> the problems can be noted with error messages in one go-round with the user,
>> rather than having submit, here's an error, fix one error, resubmit, here's
>> a 2nd error, fix, resubmit, here's a 3rd error, etc.
>>
>> Karen
>

the forms clean function is called without all the required data in
the cleand_data field.
the solution - add an extra check in the clean function to ensure all
the required data is there before running the rest of the checks


-- 
Alistair Marshall

www.thatscottishengineer.co.uk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to