Opened 18 years ago

Closed 14 years ago

Last modified 6 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, 18 years ago

Triage Stage: Unreviewed → Design decision needed

comment:2 by Chris Beaven, 16 years ago

Severity: → Normal
Type: → New feature

comment:3 by Aymeric Augustin, 15 years ago

Easy pickings: set
Triage Stage: Design decision needed → Accepted
UI/UX: unset

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

comment:4 by zefciu, 15 years ago

Owner: changed from nobody to zefciu
Status: new → assigned

comment:5 by zefciu, 15 years ago

Has patch: set

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

comment:6 by Tomek Paczkowski, 15 years ago

Triage Stage: Accepted → Ready for checkin

Looks good.

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

Resolution: → fixed
Status: assigned → closed

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, 6 years ago

Has patch: unset
Resolution: fixed → wontfix
Triage Stage: Ready for checkin → Unreviewed

#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, 6 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