Opened 18 months ago

Last modified 14 months ago

#26761 assigned New feature

Add 'help_text' property to methods in ModelAdmin.list_display

Reported by: Derek Hohls Owned by: ducdetronquito
Component: contrib.admin Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

It would be helpful to allow for a help_text property to be supplied to a custom field in the admin.

For example:

from django.contrib import admin

class AuthorAdmin(admin.ModelAdmin):
    fields = ('name', 'title', 'view_birth_date')

    def view_birth_date(self, obj):
        return obj.birth_date

    view_birth_date.help_text = 'Authors birthday'

This help text could be displayed via a 'hover over' in the header(s) of the columns in the admin list display.

Change History (6)

comment:1 Changed 18 months ago by Tim Graham

Description: modified (diff)
Keywords: admin removed
Summary: Admin - add 'help_text' property to custom fieldsAdd 'help_text' property to methods in ModelAdmin.list_display
Triage Stage: UnreviewedAccepted

comment:2 Changed 17 months ago by ducdetronquito

Owner: changed from nobody to ducdetronquito
Status: newassigned

comment:3 Changed 17 months ago by ducdetronquito

Hi,

I have made a Pull-Request for this ticket (Cf. https://github.com/django/django/pull/6880)

I am looking forward to have a review and made some changes if need be :)

comment:4 Changed 17 months ago by Tim Graham

Has patch: set

comment:5 Changed 17 months ago by ducdetronquito

Hi there,

I made some changes suggested by @profuel.
Now the PR passes all the tests \o/

Do not hesitate to tell me if something could be improved !

comment:6 Changed 14 months ago by Tim Graham

Patch needs improvement: set

I left some ideas for improvement on the PR.

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