I have an object that I'm trying to iterate over within my template.
My issue is that one of the fields response contains json data and I get this error message:
transaction' object is not iterable
{% for item in transaction %}
{{ item.notjson_fields}}
{% for jsonItem in item.response %}
{{jsonItem}}
{% endfor %}
{% endfor %}
Model:
date_created = models.DateTimeField(auto_now_add=True)
request = JSONField()
response = JSONField()
transaction?Transactionis not an iterable object like list, dict. There should be a method/property(attributet) that you are looking for from transaction. ifget_object...is what you are using, it should return an instance of the db record that matches ur query.