Opened 7 years ago

Closed 6 years ago

#11946 closed Cleanup/optimization (fixed)

ManyToOneRel.lookup_overrides is unused

Reported by: Johannes Dollinger Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

lookup_overrides is accepted as a keyword argument for ForeignKey and then stored in its ManyToOneRel. That's all.
It should either do something useful or be removed.

$ grep -rn lookup_overrides --include "*.py" django/
django/db/models/fields/related.py:631:            limit_choices_to=None, lookup_overrides=None, parent_link=False):
django/db/models/fields/related.py:641:        self.lookup_overrides = lookup_overrides or {}
django/db/models/fields/related.py:658:            limit_choices_to=None, lookup_overrides=None, parent_link=False):
django/db/models/fields/related.py:661:                lookup_overrides=lookup_overrides, parent_link=parent_link)
django/db/models/fields/related.py:699:            lookup_overrides=kwargs.pop('lookup_overrides', None),

Attachments (1)

11946.remove_lookup_overrides.diff (1.8 KB) - added by Johannes Dollinger 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Johannes Dollinger

comment:1 Changed 7 years ago by anonymous

Has patch: set

comment:2 Changed 7 years ago by anonymous

Has patch: unset
Version: 1.1SVN

comment:3 Changed 7 years ago by Johannes Dollinger

Has patch: set

...

comment:4 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedSomeday/Maybe

It may do nothing, but it has been an valid argument historically, and it's now embedded in our v1.0 API. We can't remove it without breaking any code that is using it. Marking someday/maybe, because this should be a v2.0 change.

comment:5 Changed 7 years ago by Johannes Dollinger

lookup_overrides appears to be undocumented - I can't find any mention in the 1.0, 1.2, and dev docs.
Which code would rely on an undocumented argument that does nothing (and apparently hasn't done anything useful for quite some time)?

comment:6 Changed 6 years ago by Julien Phalip

Severity: Normal
Type: Cleanup/optimization

comment:7 Changed 6 years ago by Johannes Dollinger

Easy pickings: unset
Resolution: fixed
Status: newclosed

This has apparently been fixed already.

Note: See TracTickets for help on using tickets.
Back to Top