I'm also against adding get_or_none(), for the same reasons. Adding a
method to shortcut something that can already be done doesn't seem worth it
to me.
On Sat, Jul 9, 2022 at 1:56 PM Mariusz Felisiak
wrote:
> I'm against it because it's already easily achievable and it's debatable
> how it shou
Fair enough. To me, the `get_or_none` behavior with multiple results would
still be to raise an exception (so it is just like `get` in that sense).
And that’s the reason I personally don’t just see it as a shortcut for
`filter().first()` — I have (as I’m sure others have) made the mistake
befor
Hi
I believe the main objection is against adding additional API to querysets.
get_object_or_404 only converts DoesNotExist into a 404 exception and
doesn't handle MultipleObjectsReturned.
I'm not the first to suggest adding an additional shortcut, e.g.
django.shortcuts.get_object_or_none which w