Opened 15 years ago

Closed 14 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: dev
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: no

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 15 years ago.

Download all attachments as: .zip

Change History (8)

by Johannes Dollinger, 15 years ago

comment:1 by anonymous, 15 years ago

Has patch: set

comment:2 by anonymous, 15 years ago

Has patch: unset
Version: 1.1SVN

comment:3 by Johannes Dollinger, 15 years ago

Has patch: set

...

comment:4 by Russell Keith-Magee, 15 years ago

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 by Johannes Dollinger, 15 years ago

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 by Julien Phalip, 14 years ago

Severity: Normal
Type: Cleanup/optimization

comment:7 by Johannes Dollinger, 14 years ago

Easy pickings: unset
Resolution: fixed
Status: newclosed

This has apparently been fixed already.

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