Hi Luca,
As far as I'm able to understand you need to print the elements in the
lista array corresponding to the current forloop.counter0, if this is the
case then you can do:
{% load index %}
{{ lista|index:forloop.counter0 }} // this will print the element in the
lista array corresponding
Counter0 only exists for variables declared within template itself for for
loops. Lista isn't for loop variable and thus it's always empty.
pe 4. lokak. 2019 klo 17.53 Luca Bertolotti
kirjoitti:
> from the view i give to the template the following variables
>
> selezione =
from the view i give to the template the following variables
selezione = Dbasedett.objects.filter(idbase=mod_id, revdbase=rev_test)
lista = ['test', 'test_one']
Than i return render(.{'selezione':selezione, 'lista':lista}
In the form i need to do this:
{% for dati in
3 matches
Mail list logo