[Answered ]-Accessing lists inside a dictionary with Django Template tags

1👍

You should pre-process the data in the view:

checkoutList = [
    {'id': id, 'title': title, 'location': location, 'imageurl': imageurl, 'url': url}
    for id, title, location, imageurl, url in zip(
        checkoutList['id'],
        checkoutList['title'],
        checkoutList['location'],
        checkoutList['imageurl'],
        checkoutList['url']
    )
]

then you can render this with:

{% for record in checkoutList %}
    {% for key, value in record.items %}
        {{key}} {{value}}
    {% endfor %}
{% endfor %}

Leave a comment