Opened 3 years ago
Last modified 3 years ago
#33384 closed New feature
Add `get_or_none` method — at Initial Version
Reported by: | MojixCoder | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 4.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In Django we have get
method for getting model objects.
I have seen so many projects that implement get_or_none
method in their projects.
I know that we have get_object_404
but sometimes we don't want to raise an exception.
so I think get_or_none
would be kinda useful, what do you think?
Note:
See TracTickets
for help on using tickets.