Opened 11 years ago

Closed 11 years ago

#20791 closed Cleanup/optimization (fixed)

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

Reported by: Luc Saffre 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

Description

I agree that this is nit-picky, but in db/models/fields/related.py (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."

Change History (4)

comment:1 by Sasha Romijn, 11 years ago

Cc: eromijn@… added
Easy pickings: set
Triage Stage: UnreviewedAccepted

Agreed, the current message can be confusing.

comment:2 by ersran9, 11 years ago

Has patch: set

I have created a pull request for this : https://github.com/django/django/pull/1392

comment:3 by Sasha Romijn, 11 years ago

Triage Stage: AcceptedReady 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 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 7295a8262f4f963ba7336337e2cd175be3db6f8c:

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

Backport of 311c1d2848 from master.

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