Opened 6 years ago

Closed 6 years ago

Last modified 14 months ago

#8947 closed Uncategorized (duplicate)

A way to have non-editable fields in the admin

Reported by: simon Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Normal Keywords: DjangoCon
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Adrian and Jacob on stage at DjangoCon.

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I remember we've discussed that on the dev-list a while ago:

I think something in the lines of:

class MyModelAdmin (admin.ModelAdmin)
    fields = ['name', 'bio', 'url', 'date_signup']
    readonly = ['date_signup'] 

I can see 2 cases where you'd want to display the field but not edit it:

  • fields that have editable=False and that are present in the fields/fieldsets admin options. Those would automatically be rendered read-only.
  • fields that are intrinsically editable, but that you want to be editable only by some administrators and not by others.

comment:2 Changed 6 years ago by dc

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #342

comment:3 Changed 14 months ago by anonymous

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.