1👍
The form will not call your function automatically. You will need to add in to your form a place to call your function. One place you could do this is you can override the form clean()
function. Something like this:
def clean(self):
cleaned_data = super().clean()
self.check_bounds()
This will call your function when your django form would normally call the clean()
function.
Also, I don’t really understand the purpose of the line return data
in your check_bounds()
function. What is the reason you put that line in there?
Source:stackexchange.com