Opened 9 months ago

Closed 9 months ago

#20791 closed Cleanup/optimization (fixed)

"Model %(model)s with pk %(pk)r does not exist."

Reported by: lsaffre Owned by: nobody
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords:
Cc: eromijn@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


I agree that this is nit-picky, but in db/models/fields/ (line 979 in version 1.5.1), Django issues the following message:

"Model %(model)s with pk %(pk)r does not exist."

This formulation is wrong. Not the model but a model *instance* is missing.
So I suggest to change this message to:

"%(model)s instance with pk %(pk)r does not exist."

or just:

"%(model)s with pk %(pk)r does not exist."

Attachments (0)

Change History (4)

comment:1 Changed 9 months ago by erikr

  • Cc eromijn@… added
  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Agreed, the current message can be confusing.

comment:2 Changed 9 months ago by ersran9

  • Has patch set

I have created a pull request for this :

comment:3 Changed 9 months ago by erikr

  • Triage Stage changed from Accepted to Ready for checkin

The patch looks good to me. This message does not seem to be referred to in either tests or documentation, so this should be all that is needed.

comment:4 Changed 9 months ago by Claude Paroz <claude@…>

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

In 7295a8262f4f963ba7336337e2cd175be3db6f8c:

[1.6.x] Fixed #20791 -- Reworded ForeignKey default error message

Backport of 311c1d2848 from master.

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.