I have been trying to use the new validators that are now included with Django. I have set the validators parameter on my fields and while I don't get an error, the validation doesn't seem to be working. Here is my console session that dupplicates the issue.
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> import django >>> django.VERSION (1, 2, 1, 'final', 0) >>> from django.core import validators >>> from django import forms >>> field = forms.CharField(validators=[validators.MinValueValidator(2)]) >>> field.clean("s") u's'
I would expect the field.clean("s")
to throw a validation exception since there is only one character in the string. I realize it is possible that I am misunderstanding how to use the validators, so any help would be greatly appreciated.