Reputation: 761
This is what I want to write:
categories|last.translated_name
Where categories is a list of Category objects and translated_name is a function in the Category class.
This is the error when the above invalid syntax is used:
Could not parse the remainder: '.translated_name' from 'categories|last.translated_name'
Upvotes: 0
Views: 51
Reputation: 39287
{% with categories|last as last_category %}
{{ last_category.translated_name }}
{% endwith %}
Upvotes: 3