July 2019
Beginner to intermediate
302 pages
9h 38m
English
We can replace the processes of checking for the method type being a POST or PUT request, and form validation, with a single step using validate_on_submit. So, the original code is as follows:
if request.method == 'POST' and form.validate():
This can be replaced by the following command:
if form.validate_on_submit():