Opened 7 years ago

Closed 7 years ago

Last modified 3 years 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.

Change History (3)

comment:1 Changed 7 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 7 years ago by dc

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

Duplicate of #342

comment:3 Changed 3 years ago by anonymous

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset
Note: See TracTickets for help on using tickets.
Back to Top