1
0
mirror of https://github.com/django/django.git synced 2025-07-07 19:29:12 +00:00

[soc2009/model-validation] Have model fields use EMPTY_VALUES from validators

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král 2009-06-08 00:54:45 +00:00
parent 3e625f2667
commit ca9cecb702

View File

@ -14,7 +14,7 @@ from django.db.models.query_utils import QueryWrapper
from django.dispatch import dispatcher
from django.conf import settings
from django import forms
from django.core import exceptions
from django.core import exceptions, validators
from django.utils.datastructures import DictWrapper
from django.utils.functional import curry
from django.utils.itercompat import tee
@ -135,7 +135,7 @@ class Field(object):
ugettext_lazy("This field cannot be null."))
# cannot do if not value because of 0 passed to integer fields
if not self.blank and value in ( None, '' ):
if not self.blank and value in validators.EMPTY_VALUES:
raise exceptions.ValidationError(
ugettext_lazy("This field cannot be blank."))