This is better done way it's explained here, last example:
https://docs.djangoproject.com/en/dev/ref/forms/validation/