Code

Opened 5 years ago

Closed 3 years ago

#11946 closed Cleanup/optimization (fixed)

ManyToOneRel.lookup_overrides is unused

Reported by: emulbreh 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 emulbreh 4 years ago.

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by emulbreh

comment:1 Changed 4 years ago by anonymous

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by anonymous

  • Has patch unset
  • Version changed from 1.1 to SVN

comment:3 Changed 4 years ago by emulbreh

  • Has patch set

...

comment:4 Changed 4 years ago by russellm

  • Triage Stage changed from Unreviewed to Someday/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 4 years ago by emulbreh

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 3 years ago by julien

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:7 Changed 3 years ago by emulbreh

  • Easy pickings unset
  • Resolution set to fixed
  • Status changed from new to closed

This has apparently been fixed already.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.