So is there a cleaner way to work in form.clean instead of doing
if for.cleaned_datahas_key(field):
for every element?

On Apr 7, 6:06 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 7, 2008 at 8:19 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> > If I have a required field and I do not specify a value for the field,
> > should form.clean get called? My understanding, after reading
>
> >http://www.djangoproject.com/documentation/newforms/#custom-form-and-...
> > ,
> > is that it should not, as clean_<field> will fail, and so form.clean
> > will not be called. However this is not happening with my code,
> > details follow.
>
> > I have a form like [http://dpaste.com/43538/]
>
> > [code snipped]
>
> From the page you linked to:
>
> 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.
> This approach allows you to flag all errors in the submitted data at once,
> versus having to force the user through a painful one-by-one
> fix-and-resubmit cycle for a form with multiple errors.
>
> Karen
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to