mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] 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.
Backport of eb4cdfbdd6 from master
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user