diff options
| author | Michal Petrucha <michal.petrucha@koniiiik.org> | 2016-06-09 11:56:12 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-06-09 11:57:00 -0400 |
| commit | effb4ed6f54bb747d26a2c1ce0ea6153ebc6d0a1 (patch) | |
| tree | d12031e6c0d20ecfb41f4f0bc1d4a8b6ee1d1b01 | |
| parent | 37b36af6c6e169eae2f0b503f4550f798c428a97 (diff) | |
Replaced a hardcoded LOOKUP_SEP in models/fields/__init__.py
| -rw-r--r-- | django/db/models/fields/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index e567e12250..76e19eb6e9 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -20,6 +20,7 @@ from django.core import checks, exceptions, validators # purposes. from django.core.exceptions import FieldDoesNotExist # NOQA from django.db import connection, connections, router +from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import DeferredAttribute, RegisterLookupMixin from django.utils import six, timezone from django.utils.datastructures import DictWrapper @@ -221,10 +222,10 @@ class Field(RegisterLookupMixin): id='fields.E001', ) ] - elif '__' in self.name: + elif LOOKUP_SEP in self.name: return [ checks.Error( - 'Field names must not contain "__".', + 'Field names must not contain "%s".' % (LOOKUP_SEP,), obj=self, id='fields.E002', ) |
