new object with readonly m2m field through an error in the admin
|Reported by:||benc||Owned by:||nobody|
|Severity:||Keywords:||admin, readonly_fields, m2m|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||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.