Am Dienstag, 11. Oktober 2016 17:51:20 UTC+2 schrieb Aymeric Augustin:
> I did never say "let's do business logic in templates". AFAIK,
> *displaying* errors (or preparing for it HTML-structure-wise) requires
> *knowing* whether a form is invalid or not.
> The API for displaying errors is form.errors.
> If the documentation implies otherwise, please accept my apologies!
No problem. I now did read the documentation
(https://docs.djangoproject.com/es/1.10/ref/forms/api/) to be 100% sure.
It says: "The primary task of a Form object is to validate data. With a
bound Form instance, call the is_valid() method to run validation and
return a boolean designating whether the data was valid:" and furthermore
"You can access errors without having to call is_valid() first. The form’s
data will be validated the first time either you call is_valid() or access
So, the docs are actually pretty clear about what will happen (how to code
works), but not so much about the intended usage.
I for one, however, think that this is also not necessary as the names of
those properties are pretty clear in their meaning.
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.