Which Django template tag is used to return the first not empty variable?

21. Which Django template tag is used to return the first not empty variable?

  1. empty
  2. firstempty
  3. firstemptyvar
  4. firstof

Answer: D) firstof

Explanation:

The firstof is a Django template tag that is used to return the first not empty variable. Consider the below syntax –

{% firstof variable_name_1 variable_name_2 variable_name_3 etc. %}

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.