Is it possible to specify which lookups belong together in a template?

An example: These variables are given in my template:

ITEM_NAMES = ['name 1',
              'name 2',
              'name 3']

item.type = 2

I'd like to do a ITEM_NAME[item.type] lookup. In the example above this
should return 'name 3'. The obvious thing to do is of course {{
ITEM_NAMES.item.type }}. However, this doesn't work. Apparently Django
interprets ITEM_NAMES.item.type as ITEM_NAMES[item].type.

Does something along the lines of ITEM_NAMES.(item.type) or
ITEM_NAMES..item.type exist?

Andreas

Reply via email to