I have some issues with access of a specific key in my template. Here is my code :
{% for rsim,couples in zipped_formated_rxnsim_pairedsim %}
-{{rsim.xxx_fk.xxx_code_char}} #ex : toto
{% for rsim2,couples2 in mydict.{{rsim.xxx_fk.xxx_code_char}}%}
<li> {{rsim2}} - {{couples2}}</li>
{% endfor %}
{% endfor %}
It gives me this error,
Could not parse the remainder: '{{rsim.xxx_fk.xxx_code_char}}' from 'mydict.{{rsim.xxx_fk.xxx_code_char}}'
I do not understand this behaviour, because if I hard code the line {% for rsim2,couples2 in mydict.{{rsim.pdb_fk.pdb_code_char}}%}
to {% for rsim2,couples2 in mydict.toto %}
it works ... I mean, how can I do something about this idea ?
I really need this loop structure, because I want to go through "rsim2,couples2" tuples only for a specific "rsim,couple" tuple. In others words, "rsim2,couples2", are extra data linked with "rsim,couples". What a better solution than a dictionary using a key ?
I tried using the {{with}} tag, adding a variable to use directly as a key, but it did not work. Any help would be appreciated.
Thank you !