#19120 closed Cleanup/optimization (fixed)
better document common behavior of readonly_fields and list_display
Reported by: | Daniele Procida | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I was stunned to find that I could use a model's method as a readonly_field in admin. There doesn't seem to be any hint of this in the documentation - if there is, I have missed it.
It's a really useful bit of functionality, and can give valuable feedback to the user about the current state of the object they are editing, so I am quite surprised not to see it mentioned and explained more fully.
Also, although https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fields says of it "New in Django 1.4: Please see the release notes" there's no mention of readonly_fields at https://docs.djangoproject.com/en/dev/releases/1.4/.
Finally, https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields doesn't mention "New in Django 1.4" - should it?
If I have understood this situation correctly, I'm happy to do some work on the relevant documentation.
Change History (6)
comment:1 by , 12 years ago
Easy pickings: | set |
---|---|
Summary: | readonly_fields poorly documented → better document common behavior of readonly_fields and list_display |
Triage Stage: | Unreviewed → Accepted |
Version: | 1.4 → master |
comment:4 by , 12 years ago
Has patch: | set |
---|
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for offering feedback on the documentation.
readonly_fields were actually introduced in 1.2 - for 1.5 we removed notices for things added/changed in < 1.3
The behavior of using a method is explained in https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
and the current readonly_field docs say:
This option behaves nearly identical to ModelAdmin.list_display.
- perhaps this could be more specific or clearer - so open to some rephrasing.