{% elif value is iterable and value is not string %}
{% if value|length > 0 and value[0] is mapping %}
{# Array of objects - render as table #}
Array[{{ value|length }}] of objects
#
{% for col_key in value[0].keys() %}
{{
col_key }}
{% endfor %}
{% for item in value %}
{{ loop.index }}
{% for col_key in item.keys() %}
{% if item[col_key] is mapping or (item[col_key] is iterable and item[col_key] is not string and
item[col_key]|length > 0 and item[col_key][0] is mapping) %}
{{ render_value(col_key, item[col_key], depth + 1) }}
{% else %}
{{ item[col_key] }}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{# Simple array #}
{{ value|tojson }}
{% endif %}
{% elif value is sameas true or value is sameas false %}
{{ value }}
{% elif value is number %}
{{ value }}
{% elif key and (key.endswith('_id') or key.endswith('_ids')) and value %}
{# Potential relationship field #}
{{ value }}
{% else %}
{{ value }}
{% endif %}
{% endmacro %}
{% block content %}