admin管理员组

文章数量:1123419

There are list and dictionary variables:

    list_items:
        - item_01
        - item_02
        - item_03
        - 200
      dict_items:
        item_01: item_01
        item_02: item_02
        item_03: item_02
        item_04: 100

I need to write a macro that is passed a variable name and returns this result:

"dict_items": {
  "item_01": "item_01",
  "item_02": "item_02",
  "item_03": "item_02",
  "item_04": 100
}

Can this be realized?

本文标签: How to get the variable name and output it in the templateStack Overflow