From eb4cdfbdd64a95b303eaaa40a070521aa58362fd Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 22 Jan 2015 01:43:49 -0500 Subject: Fixed #23940 -- Allowed model fields to be named `exact`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- django/db/models/fields/related.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') 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): -- cgit v1.3