A

Admin • 833.24K Points
Coach

Q. What does the `get_object_or_404()` function do?

  • (A) Deletes a model instance
  • (B) Redirects to 404 page if object is not found
  • (C) Returns None if object is not found
  • (D) Fetches object and suppresses error if not found
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category Django
  • Hashtags:

Explanation by: Admin

`get_object_or_404()` returns the object if it exists, otherwise raises a 404 error.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.