2👍
✅
The template code is no different in that you still need to access the id
instance-method of the key.
Try instead:
{% for message in messages %}
{{ message.name }}
{{ message.key.id }}
<!-------- ^^^ -->
{% endfor %}
The syntax, if you use Jinja2 templates (instead of Django templates), would be:
{% for message in messages %}
{{ message.name }}
{{ message.key().id() }}
<!-------- ^^^^^ -->
{% endfor %}
Source:stackexchange.com