November 2015
Beginner to intermediate
840 pages
26h 30m
English
Ensuring correct user input is referred to as input validation. One of the major features of Django forms is the ability to customize validation, making is_valid() do exactly as the developer desires. Django provides two validation methods: validator and clean methods.
1. A validator is a simple regular expression to which Django matches a value. A validator is therefore a Boolean check: Does the value passed to the field match the regular expression?
2. A clean method is a function that takes as input some value, processes it, and is expected to return a new, cleaned value or else to raise a ValidationError exception if the value could not be cleaned.
Validators are associated with both model fields ...
Read now
Unlock full access