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)
Change History (2)
by , 18 years ago
Attachment: | get_object_or_none.patch added |
---|
comment:1 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.