--
Ticket URL: <https://code.djangoproject.com/ticket/16180>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
The little patch in {{{django.contrib.admin.views.main}}} module would be
something like that:
{{{
#!python
ordering_fields[idx] = 'desc' if pfx == '-' else 'asc'
return ordering_fields
+ def get_ignored_lookup_params(self):
+ return IGNORED_PARAMS
+
def get_lookup_params(self, use_distinct=False):
lookup_params = self.params.copy() # a dictionary of the query
string
- for ignored in IGNORED_PARAMS:
+ for ignored in get_ignored_lookup_params():
if ignored in lookup_params:
del lookup_params[ignored]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:1>
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
added patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:2>
* needs_docs: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:3>
Comment (by msaelices):
nnrcschmdt I was working on this ticket. are you working on this too?
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:4>
Comment (by nnrcschmdt):
No, no. Go ahead.
Please set the owner to yourself.
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:5>
* needs_docs: 1 => 0
* has_patch: 1 => 0
* needs_tests: 1 => 0
Comment:
I've included in the docs the
[https://code.djangoproject.com/attachment/ticket/16195/ticket_16195.diff
patch attached] to #16195 ticket because I need to make it sense.
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:6>
* has_patch: 0 => 1
Comment:
I attached a patch with corrections to the docs for language and for
clarity. However, I wonder if this is really the solution? Really,
shouldn't lookup_params that aren't fields on the model always be ignored?
They certainly aren't security risks the same way as other items.
get_ignored_lookup_params should only be necessary if (for some reason)
there's a conflict between the name of the lookup field you want to handle
and one of the fields on the model.
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:7>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:8>
Comment (by Vaskevich Aleksander):
Is there any movement on this ticket? May I offer my PR?
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:9>
* status: new => closed
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
* resolution: => wontfix
* stage: Accepted => Unreviewed
Comment:
It's been 12 years since the ticket was opened. As far as I'm aware, this
is rather niche and monkey patching a module constant is an acceptable
approach for the reported issue. It's not worth adding extra hooks.
--
Ticket URL: <https://code.djangoproject.com/ticket/16180#comment:10>