Opened 18 years ago

Closed 18 years ago

#2659 closed enhancement (wontfix)

[patch] get_object_or_none shortcut

Reported by: Joeboy Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version: dev
Severity: normal Keywords:
Cc: django25@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I keep finding myself having to catch exceptions when I want to get an object if it exists and do something else if it doesn't. This patch provides a (hopefully) handy shortcut.

Attachments (1)

get_object_or_none.patch (650 bytes ) - added by Joeboy 18 years ago.

Download all attachments as: .zip

Change History (2)

by Joeboy, 18 years ago

Attachment: get_object_or_none.patch added

comment:1 by Adrian Holovaty, 18 years ago

Resolution: wontfix
Status: newclosed

I'm marking this as a wontfix because it's a bit of feature creep. While I could see how this would be useful to some, this doesn't offer anything revolutionary, and people can just include the function in their own codebase if they find themselves needing it.

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