Consider these two dictionaries:
a = {'f': 'foo'}
b = {'bar': 20,
'foo': 10}
In Python, should I want to use the value of one dictionary as a key to another, I can do:
print(b[a['f']])
>>>10
However, in Django, I haven't been able to implement the same. I have tried using these:
{{ b.{{a.f}} }}
which result in
Could not parse the remainder: '{{a.f from 'b.{{a.f'
Similarly I have tried using these:
{{ b.{{a['f']}} }}
{{ b[a['f']] }}
{{ b[a.f] }}
None of them seem to work.
What should I do to implement the above said python code in Django Template Language