hi all
if i print the query_dict i would get this:
{yr=2014, onoff=0}
i would like to get the
keys
as well as the values for further use but manage only to get the values. how could i read the key’s?
1 |
yr
| 2014
2 |
onoff
| 0
unfortunately this did not work:
{% for
key
, value in request.query_dict %}
{{ loop.index }} | {{
key
}} | {{ value }}<br>
{% endfor %}
Hey @diavolino are you still having difficulty? Are you able to select deal stage before creating a new deal?
dannio
August 24, 2020, 3:16am
3
Can confirm, this only returns the values, not the keys
stefen
August 26, 2020, 5:47pm
4
@diavolino I think you forgot the “.items()”. Try this:
{% for key, value in request.query_dict.items() %}
{{ loop.index }} | {{ key }} | {{ value }}<br>
{% endfor %}
dannio
August 27, 2020, 3:11am
5
Thanks @stefen , that worked. Is there no documentation on this anywhere? The only reference I found on the hubl documentation is for the general request.query_dict term.
stefen
August 27, 2020, 12:51pm
6
dannio
August 28, 2020, 8:54am
7
Ahh yes, I missed the “.items()” part. Too used to other languages not having it!
Thanks a lot!