Template filter to get a list element by its index

1
2
3
4
5
6
7
from django import template

register = template.Library()

@register.filter
def get_at_index(list, index):
    return list[index]

More like this

  1. Template filter that divides a list into exact columns by davmuz 2 years, 3 months ago
  2. Template tag to sort a list of links by pytechd 6 years, 8 months ago
  3. Tags & filters for rendering search results by exogen 6 years, 1 month ago
  4. Recurse template tag for Django by Zarin 6 years, 2 months ago
  5. filter for extracting a number of paragraphs from any HTML code by rafadev 2 years, 10 months ago

Comments

(Forgotten your password?)