I have a list created in Django view:
list = [ elem1, elem2, ..., elemN ] The list is variable length: it can contain 0-6 elements. I want to iterate over the list in the template, but I would like the loop to run always 6 times, yielding None or empty string for non-existing elements.
I tried something like this:
{% for i in "0123456" %} {{ list.i }} {% endfor %} but this obviously doesn't work. I know I could do this in the view, but I would like to have this in the template. Is is possible?