SebastianM6L, Why isn't
Model.objects.get_or_none()
a thing in #django ?
That would save some boilerplate code or am I wrong?
Because if there is a chance that there is no entry for the query
get()
will raise aDoesNotExist
exception that you have to catch.
get_or_none()
would be cleaner in my opinion.
Add comment