home / django_tickets / tickets

tickets: 16180

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
16180 2011-06-09 09:55:31 2013-06-11 09:43:18 2022-03-06 04:02:29.743507 Accepted new contrib.admin New feature Normal dev   IGNORED_PARAMS customization Several times you "hack" the admin interface and want to use extra GET parameters. Look at this example: {{{ #!python class FooModelAdmin(admin.ModelAdmin): # ... def get_list_display(self, request, extra_context=None): if request.GET.has_key('hide_columns'): return ('pk', ) return super(FooModelAdmin, self).get_list_display(request, extra_context) }}} But this is impossible because the "hide_columns" GET parameter is not allowed by security reasons. The allowed parameters ({{{IGNORED_PARAMS}}} global variable) is hardcoded (look at [source:django/trunk/django/contrib/admin/views/main.py#L29 this code]). Should be good if you should configure this parameters. I don't know if a new setting should be good or maybe a {{{ChangeList.get_ignored_lookup_params()}}} method to do something like that: {{{ #!python class FooChangeList(ChangeList): def get_ignored_lookup_params(self): return super(FooChangeList, self).get_ignored_lookup_params() + ['hide_columns'] }}} Of course you can extends the {{{ChangeList}}} and override the {{{ChangeList.get_lookup_params()}}} method but should be better of using a special method for this useful thing. nobody msaelices   0 1 1 0 0 0
Powered by Datasette · Queries took 0.94ms