Code

Ticket #11946: 11946.remove_lookup_overrides.diff

File 11946.remove_lookup_overrides.diff, 1.8 KB (added by emulbreh, 4 years ago)
Line 
1Index: django/db/models/fields/related.py
2===================================================================
3--- django/db/models/fields/related.py  (revision 11624)
4+++ django/db/models/fields/related.py  (working copy)
5@@ -628,7 +628,7 @@
6 
7 class ManyToOneRel(object):
8     def __init__(self, to, field_name, related_name=None,
9-            limit_choices_to=None, lookup_overrides=None, parent_link=False):
10+            limit_choices_to=None, parent_link=False):
11         try:
12             to._meta
13         except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT
14@@ -638,7 +638,6 @@
15         if limit_choices_to is None:
16             limit_choices_to = {}
17         self.limit_choices_to = limit_choices_to
18-        self.lookup_overrides = lookup_overrides or {}
19         self.multiple = True
20         self.parent_link = parent_link
21 
22@@ -655,10 +654,10 @@
23 
24 class OneToOneRel(ManyToOneRel):
25     def __init__(self, to, field_name, related_name=None,
26-            limit_choices_to=None, lookup_overrides=None, parent_link=False):
27+            limit_choices_to=None, parent_link=False):
28         super(OneToOneRel, self).__init__(to, field_name,
29                 related_name=related_name, limit_choices_to=limit_choices_to,
30-                lookup_overrides=lookup_overrides, parent_link=parent_link)
31+                parent_link=parent_link)
32         self.multiple = False
33 
34 class ManyToManyRel(object):
35@@ -696,7 +695,6 @@
36         kwargs['rel'] = rel_class(to, to_field,
37             related_name=kwargs.pop('related_name', None),
38             limit_choices_to=kwargs.pop('limit_choices_to', None),
39-            lookup_overrides=kwargs.pop('lookup_overrides', None),
40             parent_link=kwargs.pop('parent_link', False))
41         Field.__init__(self, **kwargs)
42