Refactor a generator out from part of SQLCompiler.get_order_by()
I noticed that SQLCompiler.get_order_by() has a 70-line chunk of code whose job is to build up an order_by list, which is then iterated over right after. That chunk of code has 8 order_by.append() lines and an order_by.extend(). It looks like this could be made cleaner by pulling those lines out into a private method that is instead a generator that yields those pairs. That would eliminate the need for having order_by.append() in several spots, and it would reduce the size of the method into two smaller methods.
Change History
(6)
| Description: |
modified (diff)
|
| Component: |
Uncategorized → Database layer (models, ORM)
|
| Triage Stage: |
Unreviewed → Accepted
|
| Owner: |
changed from nobody to Chris Jerdonek
|
| Status: |
new → assigned
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
PR: https://github.com/django/django/pull/14292