I am trying to use include
to embed one child template into parent template. In the parent template, suppose I need to pass variables as following ( as per the documentation here):
{% include "table/order_item_modals.html" with item_change_form_list=item_change_form_list %}
This works if the variable item_change_form_list
is non-object type (such as string, numeric, of normal list, etc). If I want to pass a zip
object, the above tag does not work.
The reason I want to pass a zip
object is because in my child template, I would like to use for
loop over multiple lists in parallel, similar to a problem in this thread.
Here, my variable item_change_form_list
is defined as following in the view:
item_change_form_list = zip (list1, list2, list3)
Is it possible to pass a zip
object in the include
tag? Thanks.