django template: iterate and print just items with index for example 3,6,9 -


is there way iterate through list in django template , print items index example 3,6,9 , on...

let's imagine have list this:

({'title':'first'}, {'title':'second'}, {'title':'third'}, .... {'title':'ninth '}) 

and in template want see just:

third sixth ninth 

i know how pass variable template, construct in view, need way how iterate through them in template , print want.

or need construct list (or dictionary maybe) somehow differently? using latest django.

thanks, ignas

the slice filter allow slice sequence in python.

{{ mylist|slice:"2::3" }} 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -