diff options
| author | Honza Král <honza.kral@gmail.com> | 2009-06-08 00:54:45 +0000 |
|---|---|---|
| committer | Honza Král <honza.kral@gmail.com> | 2009-06-08 00:54:45 +0000 |
| commit | ca9cecb70280d55bff0e4422e996f40f8e1ea8ca (patch) | |
| tree | 6ae4c5f99124d3c398dcdb3dd70505fc1100cd5f | |
| parent | 3e625f26672a0f886fbb47407d140c3ccf74fdaf (diff) | |
[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
| -rw-r--r-- | django/db/models/fields/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index bc3b27fb6a..f6044d9ccf 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -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.")) |
