A

Admin • 833.24K Points
Coach

Q. What will `{{ value|default:'N/A' }}` do in a template?

  • (A) Always return 'N/A'
  • (B) Set value to 'N/A'
  • (C) Return 'N/A' if value is undefined or None
  • (D) Throws error for empty value
  • Correct Answer - Option(C)
  • Views: 29
  • Filed under category Django
  • Hashtags:

Explanation by: Admin

`default` is a filter that returns the default value if the original is undefined or None.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.