Answers for "django return only part of string"

1

django return only part of string

{{ model.field|truncatewords:30 }}
# Example below returns just the first 30 words of the text_summary column 
# (for each line/book in the books table)
<ul>
{% for book in books.all %}
	<li>{{ book.text_summary|truncatewords:30 }}</li>
{% endfor %}
</ul>
Posted by: Guest on September-03-2021

Code answers related to "django return only part of string"

Python Answers by Framework

Browse Popular Code Answers by Language