Opened 5 years ago

Last modified 11 days ago

#12952 new Cleanup/optimization

Models history doesn't use verbose names

Reported by: acangiano Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: vvangelovski@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

The history for a model object (within the admin section) should show human-readable messages, favoring verbose names over field names. However, this is not currently the case. For example, consider a model with the following class variable:

pub_date = models.DateTimeField("date published")

Changing the publication date for an object of that model, will display "Changed pub_date." in its admin history, rather than "Change date published." as one would expect (as older versions of Django did).

Attachments (2)

django-admin-history-verbose-name.diff (1.8 KB) - added by Alex 5 years ago.
Initial patch, probably needs tests.
admin_history.diff (4.0 KB) - added by vasiliyeah 4 years ago.

Download all attachments as: .zip

Change History (15)

Changed 5 years ago by Alex

Initial patch, probably needs tests.

comment:1 Changed 5 years ago by russellm

  • Has patch set
  • milestone 1.2 deleted
  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by lukeplant

  • Type set to Bug

comment:3 Changed 4 years ago by lukeplant

  • Severity set to Normal

comment:4 Changed 4 years ago by vasiliyeah

  • Easy pickings unset
  • Patch needs improvement set
  • UI/UX unset
Last edited 4 years ago by vasiliyeah (previous) (diff)

comment:5 Changed 4 years ago by vasiliyeah

  • Patch needs improvement unset
  • UI/UX set

comment:6 Changed 4 years ago by vasiliyeah

  • Cc vvangelovski@… added

Changed 4 years ago by vasiliyeah

comment:7 Changed 4 years ago by vasiliyeah

  • Needs tests unset

Updated patch to apply to current trunk and added a test for the history view.

comment:8 Changed 4 years ago by julien

  • Triage Stage changed from Accepted to Design decision needed

Marking as DDN until an answer to ticket:14358#comment:3 is provided.

comment:9 Changed 3 years ago by aaugustin

  • Triage Stage changed from Design decision needed to Accepted

The objection was "for debug purposes, it would be more useful to have the field names, as they are necessarily unique, untranslated, etc."

In my opinion:

  • uniqueness is a weak argument: if you have two fields with the same name, you're just asking for trouble;
  • translation isn't an issue at all: in doubt, just switch the website to the default language of your codebase.

comment:10 Changed 3 years ago by aaugustin

#14358 is a duplicate and has patches too.

comment:11 Changed 11 months ago by timo

  • Patch needs improvement set

Patch will need to be updated to apply cleanly.

comment:12 Changed 13 days ago by agamdua

  • Patch needs improvement unset

A Github pull request (#4496) has been opened for this ticket.

comment:13 Changed 11 days ago by timgraham

  • Type changed from Bug to Cleanup/optimization
  • Version changed from 1.2-beta to master

I am thinking it might be best to try to address #21113 first (allow messages to be translated to the current language rather than displaying the language that was active for editing) since this ticket would require a new implementation for that one.

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