﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34724	Allow passing kwargs to django.contrib.admin.decorators.display	Abdullah Alaqeel	nobody	"There are many packages that depend on assigning custom params to ModelAdmin methods. One package we use regularly is [https://github.com/lukasvinclav/django-admin-actions django-admin-actions] which requires writing something like:

{{{
@admin.register(ExampleModel)
class CustomAdmin(ActionsModelAdmin):
    actions_list = ('custom_list_action', )

    def custom_list_action(self, request):
        # custom logic here
        return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
    custom_list_action.short_description = _('Custom name')
    custom_list_action.url_path = 'clean-url-path-1'
}}}

However, when using django.contrib.admin.decorators.display, it will be:

{{{
@admin.register(ExampleModel)
class CustomAdmin(ActionsModelAdmin):
    actions_list = ('custom_list_action', )

    @admin.display(description=_('Custom name'))
    def custom_list_action(self, request):
        # custom logic here
        return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
    custom_list_action.url_path = 'clean-url-path-1'
}}}

It would be really helpful/clean if we can pass any kwargs we want to the decorator, so that the code looks like:
{{{
@admin.register(ExampleModel)
class CustomAdmin(ActionsModelAdmin):
    actions_list = ('custom_list_action', )

    @admin.display(description=_('Custom name'), url_path='clean-url-path-1')
    def custom_list_action(self, request):
        # custom logic here
        return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
}}}

I know that creating a custom decorator (either by the users or the package maintainers) is trivial but I think there is value to the community to add the kwargs support natively. "	New feature	closed	contrib.admin	dev	Normal	wontfix		Nick Pope	Unreviewed	0	0	0	0	0	0
