November 2015
Beginner to intermediate
840 pages
26h 30m
English
tag_form.htmlRecall that our template RequestContext is passed the unbound or bound form variable. In the case of a bound form, we have access to a dictionary named errors, which allows us to print an error by using the name of the field as attribute. For example, should our name field have an error, we can print the error text with {{ form.errors.name }}. Further recall that a template will not error in the event we call a template variable that does not exist. Consequently, we can call or reference values of form without checking for their existence.
Consider that we can check all of these values in the interpreter, accessed in the command line by ./manage.py shell, as shown in Example 8.2.
Example 8.2: Python ...
Read now
Unlock full access