summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-01-22 01:43:49 -0500
committerSimon Charette <charette.s@gmail.com>2015-01-29 14:40:20 -0500
commiteb4cdfbdd64a95b303eaaa40a070521aa58362fd (patch)
tree424e70b5d869d223663f4c691b0e40a8035a26f2 /django
parent55c76f4e3bab74c8544b72d11a99e94a1c2cfbce (diff)
Fixed #23940 -- Allowed model fields to be named `exact`.
An explicit `__exact` lookup in the related managers filters was interpreted as a reference to a foreign `exact` field. Thanks to Trac alias zhiyajun11 for the report, Josh for the investigation, Loïc for the test name and Tim for the review.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/related.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 6952518d5d..3a4cf17df3 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -681,7 +681,7 @@ def create_foreign_related_manager(superclass, rel_field, rel_model):
def __init__(self, instance):
super(RelatedManager, self).__init__()
self.instance = instance
- self.core_filters = {'%s__exact' % rel_field.name: instance}
+ self.core_filters = {rel_field.name: instance}
self.model = rel_model
def __call__(self, **kwargs):