Opened 15 years ago

Closed 12 years ago

Last modified 3 years ago

#10494 closed New feature (wontfix)

show query params DoesNotExist from QuerySet.get

Reported by: Dave Brondsema Owned by: zefciu
Component: Database layer (models, ORM) Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In db.models.query.QuerySet.get, it'd be nice if it included kwargs when raising DoesNotExist, like it does when it raises MultipleObjectsReturned

Change History (9)

comment:1 by Jacob, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by Chris Beaven, 13 years ago

Severity: Normal
Type: New feature

comment:3 by Aymeric Augustin, 12 years ago

Easy pickings: set
Triage Stage: Design decision neededAccepted
UI/UX: unset

I'm not sure why this is flagged as DDN. Informative exceptions are good.

comment:4 by zefciu, 12 years ago

Owner: changed from nobody to zefciu
Status: newassigned

comment:5 by zefciu, 12 years ago

Has patch: set

Created a patch as a pull request: https://github.com/django/django/pull/110

comment:6 by Tomek Paczkowski, 12 years ago

Triage Stage: AcceptedReady for checkin

Looks good.

comment:7 by Anssi Kääriäinen, 12 years ago

Resolution: fixed
Status: assignedclosed

In [17917]:

Fixed #10494 -- Added kwargs to QuerySet.get() error message in the case no objects were found.

Thanks brondsem for the report, Szymon Pyzalski for the patch and oinopion for review.

comment:8 by Mariusz Felisiak, 3 years ago

Has patch: unset
Resolution: fixedwontfix
Triage Stage: Ready for checkinUnreviewed

#32522 is a duplicate,

This ticket was fixed in d5b93d3281fe93cbef5de84a52001f64dbd839bd but the patch was reverted in 266c0bb23e9d64c47ace4d162e582febd5a1e336. I'm not sure it's worth additional complexity and really helpful for beginners.

We could reopen after a discussion and reaching consensus on DevelopersMailingList.

comment:9 by Anders Hovmöller, 3 years ago

It's fairly common that beginners are confused in ways that would be trivially solved by this improvement. I base this on experience in the Django Discord.

On a more personal note, this would help me a lot in speeding up debugging in the rare cases it happens to me in production.

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