Opened 9 years ago

Closed 9 years ago

#2659 closed enhancement (wontfix)

[patch] get_object_or_none shortcut

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

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 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Joeboy

comment:1 Changed 9 years ago by adrian

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

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