Am Dienstag, 11. Oktober 2016 17:51:20 UTC+2 schrieb Aymeric Augustin:
>
> On 11 Oct 2016, at 14:52, Sven R. Kunze <srk...@gmail.com <javascript:>> 
> wrote:
>
> 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 
errors."

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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3e6fe46a-2eaf-43a4-afe5-61b58c6b5258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to