Opened 14 months ago

Closed 14 months ago

Last modified 13 months ago

#28771 closed Cleanup/optimization (wontfix)

Add a model field option that corresponds to the short_description admin property

Reported by: Rick Graves Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords: admin listview column names
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


You can put in a [long] description of the column in the table definition. That's good.

But if you want a short description as a column heading on the Admin interface list, you have to jump through hoops.

IMHO, if long description can be a column property, short description could ALSO be a column property.

Overall, django is great, thanks!

Change History (3)

comment:1 Changed 14 months ago by Tim Graham

Resolution: wontfix
Status: newclosed
Summary: column short description could be a property of the column: listview column headingAdd a model field option that corresponds to the short_description admin property

I think what you refer to as "long description" is the verbose_name argument. This is used in many places throughout Django.

I think more use cases than a shortcut for short_description in the admin is needed to justify adding a new model field option. This is also the type of proposal that needs a consensus on the DevelopersMailingList before we proceed with it. Feel free to post there if you can add more justification to your proposal.

comment:2 Changed 13 months ago by Rick Graves

Two points:

1) verbose_name is a property of the column, but short_description is not, BECAUSE it has already been put somewhere else.

2) Putting short_description somewhere else wastes CPU ticks. Not a huge deal, but sub optimal. On the admin listing, if all you want is a short description as a column heading, you must do that by writing a function returning the column value that must execute for every row down the page. Executing the function to return the value takes more CPU ticks than the putting in the default, the column value. Not only that, if the column is Boolean, the function loses the cute green check and red X graphic, instead you get somewhat austere "True" and "False". So to get a short_description at the top of the Boolean column without the austere "True" or "False", you must write a more involved function -- just to get a short_description at the top of the column.

Again, I concede there may be higher priorities. But as to whether the choice to put short_description somewhere other than as a column property is optimal, you could consult anyone without a conflict of interest proficient in object oriented or database design.

comment:3 Changed 13 months ago by Claude Paroz

I was confronted to this recently in one of my projects.
I think the use case is valid, but I'm not convinced either that this should be a model option. If it's admin-related, this should be settable somewhere inside a ModelAdmin class.

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