How do you limit list objects template side, rather than view side

There is a slice filter that you can use in templates. This works exactly the same as slicing within the view.

{% for new in news|slice:":10" %}

Leave a Comment