Implement get_list_or_404() #8515
-
Are there any reasons why we don't have |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
So our default behaviour is to return an empty list if there are no results, rather than a 404. I think that behaviour is more intuitive than returning a 404 if there are no results. (I don't think we expose a |
Beta Was this translation helpful? Give feedback.
So our default behaviour is to return an empty list if there are no results, rather than a 404.
I think that behaviour is more intuitive than returning a 404 if there are no results.
(I don't think we expose a
get_object_or_404
function to the public API, so I'm not exactly clear what API change you're suggesting. Are you suggesting that we change the behaviour of ListAPIView to 404 instead of returning an empty list?)