On Thu, Jul 14, 2022 at 4:09 PM Dave Gaeddert <dave.gaedd...@gmail.com> wrote:
> Yeah, I hope I'm not coming off as being too pushy, but I'm just curious > why that is. Mariusz or Adam, did what I said about it being *more* than > just an alias for `filter().first()` make sense or am I missing something? > (Different behavior for multiple results — on accident or otherwise) > Speaking for myself: I’d be against it because we’re getting into combinatorial territory with diminishing returns. Adding this one opens the door to equally long and repetitive threads in the future asking for all the others, and with less room to push back each time. Currently, Django covers the common cases of “if you didn’t find a match, 404” and “if there’s not exactly one result for this, throw an exception and let me catch it”. The fact that you can make other variants kinda work if you use first() or similar methods doesn’t, to me, obligate Django to also provide the full matrix of methods doing all the someone-might-want-it combinations of DoesNotExist, MultipleObjectsReturned, and None. People who want specific behaviors not covered by the built-in stuff should write their own, or somebody should make a django-all-the-get-single-object-methods package and everybody who wants one of these methods can install and use it. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAL13Cg_UjHey%3DnTq8y0zycbCAQe9Cx%3DMh%2BaVFDu1hjukmae3pg%40mail.gmail.com.