Django

Code

Ticket #342 (closed: wontfix)

Opened 3 years ago

Last modified 2 months ago

Add a way for fields to be displayed in the admin without being editable

Reported by: Bless Assigned to: nobody
Milestone: Component: Admin interface
Version: newforms-admin Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When editable=False option is used then that field isn't showed in the form.

But it should be an option for show a field without can to editing it.

Attachments

Change History

08/19/05 15:52:39 changed by adrian

  • summary changed from editable option - suggestion to Add a way for fields to be displayed in the admin without being editable.

01/17/07 22:14:32 changed by SmileyChris

  • stage changed from Unreviewed to Design decision needed.

Personally, I think it's a good idea too (something like readonly=True).

What's the word from the men upstairs?

03/09/07 06:00:28 changed by mtredinnick

  • stage changed from Design decision needed to Accepted.

Yes, this is useful. However, they should just be displayed inline (perhaps surrounded with some styling), without using an input widget with readonly="true" or anything like that. These are truly non-editable fields, not just temporarily disabled. So insert them into the form as text.

04/08/07 10:23:02 changed by philippe.raoult@gmail.com

09/16/07 06:26:37 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to wontfix.

newforms-admin will obsolete this; you will, in theory, be able to write your own customized interface to do whatever you'd like, and in the current admin this goes against the explicitly-stated philosophy of the admin interface.

05/11/08 13:33:20 changed by anonymous

  • status changed from closed to reopened.
  • version changed from 1.0 to newforms-admin.
  • resolution deleted.

newforms-admin will not obsolete this. To have non editable fields in admin, even with newforms-admin, you have to inherit from the template and have some "if field in readonly_fields: skip" logic, thus hardcoding the list of readonly fields in a non-standard place, which is sub-optimal and doesn't scale. Having an option in ModelAdmin? like readonly_fields=... is the proper way to handle this.

05/11/08 23:07:52 changed by ubernostrum

  • status changed from reopened to closed.
  • resolution set to wontfix.

No, really, you'll be able to write this in pure Python by using widget attributes when you set up the form. Plus, once again, it goes against the stated philosophy of the admin interface, which is that it's for actually administering data, not merely viewing it.


Add/Change #342 (Add a way for fields to be displayed in the admin without being editable)




Change Properties
Action