Opened 9 years ago

Closed 9 years ago

#13225 closed (duplicate)

new object with readonly m2m field through an error in the admin

Reported by: benc Owned by: nobody
Component: contrib.admin Version: 1.2-beta
Severity: Keywords: admin, readonly_fields, m2m
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I have a model with m2m field that I want to be readonly.

I want the admin user to be able to see this field but not edit it and I'll populate it in the model save method.

When trying to create a new model instance I'm getting:

instance needs to have a primary key value before a many-to-many relationship can be used.

It should be able to just put an empty string or None in the readonly field.


Change History (1)

comment:1 Changed 9 years ago by Karen Tracey

Resolution: duplicate
Status: newclosed

This is a dupe of #13004.

Note: See TracTickets for help on using tickets.
Back to Top