Code

Opened 4 years ago

Closed 4 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: UI/UX:

Description

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.

Thanks

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This is a dupe of #13004.

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.