Re: list of lists in template
On Fri, Jan 7, 2011 at 12:22 PM, gintare wrote: > > in view.py > ... > Ltarp.append([item.Wordword, item.WordTranslEn, item.WordNotesGram, > item.WordConcl]) > .. > Lans.append([sen.Sent, sen.SentTransl, Ltarp ] ) > > in template.html > {% if Lans %} > > {% for smth in Lans %} > > {{smth.0}} > >{% for Ltarp in smth.3 %} > Change this to: {% for Ltarp in smth.2 %} I think this is what you are trying to do. > > {{Ltarp.0}} > > >{% endfor %} > > > {% endfor %} > > {% endif %} > > ### > > the rows from smth.0 are shown > the rows from Ltarp in smth.3, i.e. {{Ltarp.0}} are not shown. > > I tried also:Ltarp, Ltarp[0], smth.Ltarp.0 > > nothing works in the second for cycle where i need to get items from > list built in third item of list in the first for cycle. > > Could you please help with syntax, when i need to dislay item from > list in another list in template > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > Thanks, Subhranath Chunder. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
RE: list of lists in template
{% for Ltarp in smth.3 %} SHOULD BE {% for Ltarp in smth.2 %} 'cos Lans only has 3 elements and Ltarp is Lans[2]. Chris -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of gintare Sent: 07 January 2011 08:52 To: Django users Subject: list of lists in template in view.py ... Ltarp.append([item.Wordword, item.WordTranslEn, item.WordNotesGram, item.WordConcl]) .. Lans.append([sen.Sent, sen.SentTransl, Ltarp ] ) in template.html {% if Lans %} {% for smth in Lans %} {{smth.0}} {% for Ltarp in smth.3 %} {{Ltarp.0}} {% endfor %} {% endfor %} {% endif %} ### the rows from smth.0 are shown the rows from Ltarp in smth.3, i.e. {{Ltarp.0}} are not shown. I tried also:Ltarp, Ltarp[0], smth.Ltarp.0 nothing works in the second for cycle where i need to get items from list built in third item of list in the first for cycle. Could you please help with syntax, when i need to dislay item from list in another list in template -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: list of lists in template
Thanks On Jan 7, 9:27 am, Chris Matthews wrote: > {% for Ltarp in smth.3 %} > SHOULD BE > {% for Ltarp in smth.2 %} > 'cos Lans only has 3 elements and Ltarp is Lans[2]. > > Chris > > -Original Message- > From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On > Behalf Ofgintare > Sent: 07 January 2011 08:52 > To: Django users > Subject: list of lists in template > > in view.py > ... > Ltarp.append([item.Wordword, item.WordTranslEn, item.WordNotesGram, > item.WordConcl]) > .. > Lans.append([sen.Sent, sen.SentTransl, Ltarp ] ) > > in template.html > {% if Lans %} > > {% for smth in Lans %} > > {{smth.0}} > > {% for Ltarp in smth.3 %} > > {{Ltarp.0}} > > > {% endfor %} > > > {% endfor %} > > {% endif %} > > ### > > the rows from smth.0 are shown > the rows from Ltarp in smth.3, i.e. {{Ltarp.0}} are not shown. > > I tried also:Ltarp, Ltarp[0], smth.Ltarp.0 > > nothing works in the second for cycle where i need to get items from > list built in third item of list in the first for cycle. > > Could you please help with syntax, when i need to dislay item from > list in another list in template > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.