Skip to content

Implement get_list_or_404() #8515

Discussion options

You must be logged in to vote

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?)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yyyyyyyan
Comment options

@zarinpy
Comment options

Answer selected by yyyyyyyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants