django jinja subset string

Solutions on MaxInterview for django jinja subset string by the best coders in the world

showing results for - "django jinja subset string"
Janice
11 Aug 2016
1{{ model.field|truncatewords:30 }}
2# Example below returns just the first 30 words of the text_summary column 
3# (for each line/book in the books table)
4<ul>
5{% for book in books.all %}
6	<li>{{ book.text_summary|truncatewords:30 }}</li>
7{% endfor %}
8</ul>