Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25248 closed New feature (invalid)

Incorrect readonly_fields representation for some fields

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

Description

Values of fields in readonly_fields in most cases shown as raw values.
I suppose it's incorrect for some fields.

I expected the following behavior:

  • CharField with 'choices' attribute should be shown as choice description instead of raw DB value;
  • date/time fields should be shown localized (tz, country format);
  • FileField should be shown as the link to file (if possible) (related to #14497 [closed, fixed], but I still see plain text with relative file path);
  • FilePath - the same as FileField (if possible: only if file can be downloaded);
  • ImageField should be shown as image or at link to image file like in FileField;
  • ManyToMany should be shown as list of objects str instead of 'app.model.None' string.

Am I right or current behavior is a feature? :)

Change History (2)

comment:1 by Simon Charette, 9 years ago

Triage Stage: UnreviewedAccepted
Version: 1.8master

It makes sense, patches welcome.

comment:2 by Mikhail, 9 years ago

Resolution: invalid
Status: newclosed

Sorry for premature ticket creation, seems all is fine on django side.

Firstly it was error in django-money side when it's incorrectly override django.contrib.admin.utils.AdminReadonlyField.contents method in djmoney/__init__.py (seems it was old version of the method historically remains).
Secondly I'm using incorrect translation some real fields to virtual.

Django's display_for_field() do their job fine.

Version 0, edited 9 years ago by Mikhail (next)
Note: See TracTickets for help on using tickets.
Back to Top