Opened 2 years ago

Closed 2 years ago

#19469 closed Cleanup/optimization (fixed)

Remove opts.get_ordered_objs()

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

Description

The django.db.models.options.Options.get_ordered_objs() doesn't do anything. It seems it was meant to be used by the admin, and the admin has some references to it, but nothing is actually done by it.

There are also some related javascript files: admin/ordering.js and getElementsBySelector.js which are not used by anything in Django - they would have been used had get_ordered_objs() done actually something.

The patch at https://github.com/akaariai/django/commit/baaa15b9e8c4acabd4ab68c66a9444f5c1c97e68 removes these and some references in templates, too. The question is if the changes in templates or the javascript files are likely to be used in existing projects - if so there is little reason to remove the code as keeping them around isn't a big maintenance burden.

Change History (2)

comment:1 Changed 2 years ago by akaariai

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

I think I will just commit what I have. If somebody needs any of the removed code it will be fairly simple to resurrect. And, I don't think the code will be missed...

comment:2 Changed 2 years ago by Anssi Kääriäinen <akaariai@…>

  • Resolution set to fixed
  • Status changed from new to closed

In d7b49f5b0dcecfcc9b5a77632ecbba88e7637490:

Fixed #19469 -- Removed opts.get_ordered_objects() and related code

The code was dead-code since 2006.

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