#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 , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.8 → master |
comment:2 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
It makes sense, patches welcome.