[Django] #25248: Incorrect readonly_fields representation for some fields

7 views
Skip to first unread message

Django

unread,
Aug 7, 2015, 3:24:58 PM8/7/15
to django-...@googlegroups.com
#25248: Incorrect readonly_fields representation for some fields
-------------------------------+--------------------
Reporter: vmspike | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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? :)

--
Ticket URL: <https://code.djangoproject.com/ticket/25248>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 7, 2015, 5:22:42 PM8/7/15
to django-...@googlegroups.com
#25248: Incorrect readonly_fields representation for some fields
-------------------------------+------------------------------------

Reporter: vmspike | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by charettes):

* needs_docs: => 0
* needs_better_patch: => 0
* version: 1.8 => master
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

It makes sense, patches welcome.

--
Ticket URL: <https://code.djangoproject.com/ticket/25248#comment:1>

Django

unread,
Aug 8, 2015, 11:18:20 AM8/8/15
to django-...@googlegroups.com
#25248: Incorrect readonly_fields representation for some fields
-------------------------------+------------------------------------
Reporter: vmspike | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by vmspike):

* status: new => closed
* resolution: => invalid


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/25248#comment:2>

Reply all
Reply to author
Forward
0 new messages