Add QuerySet.get_or_none()
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.
There are also some python ORMs that have this feature for example tortoise-orm, ormar, peewee, etc.
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?
Change History
(4)
| Summary: |
Add `get_or_none` method → Add get_or_none method
|
| Description: |
modified (diff)
|
| Description: |
modified (diff)
|
| Component: |
Uncategorized → Database layer (models, ORM)
|
| Resolution: |
→ duplicate
|
| Status: |
new → closed
|
| Summary: |
Add get_or_none method → Add QuerySet.get_or_none()
|
Duplicate of #2659 and #11352, both of which were wontfixed.