Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 7, 2011 06:55:16

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

list of lists in template


in view.py
...
Ltarp.append()
..
Lans.append( )

in template.html
{% if Lans %}

{% for smth in Lans %}
<table >
<tr> <td width='500'> {{smth.0}} </td></tr>

{% for Ltarp in smth.3 %}
<tr>
<td width='500'> {{Ltarp.0}} </td>

</tr>
{% endfor %}

</table>
{% 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, 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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 7, 2011 07:18:39

Subhranath C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

list of lists in template


On Fri, Jan 7, 2011 at 12:22 PM, gintare <g.statk...@gmail.com> wrote:

>
> in view.py
> ...
> Ltarp.append()
> ..
> Lans.append( )
>
> in template.html
> {% if Lans %}
>
> {% for smth in Lans %}
> <table >
> <tr> <td width='500'> {{smth.0}} </td></tr>
>
> {% for Ltarp in smth.3 %}
>

Change this to:
{% for Ltarp in smth.2 %}

I think this is what you are trying to do.



> <tr>
> <td width='500'> {{Ltarp.0}} </td>
>
> </tr>
> {% endfor %}
>
> </table>
> {% 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, 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<django-users%2bunsubscr...@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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 7, 2011 11:55:12

Chris M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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.

Chris

-----Original Message-----
From: django-users@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()
..
Lans.append( )

in template.html
{% if Lans %}

{% for smth in Lans %}
<table >
<tr> <td width='500'> {{smth.0}} </td></tr>

{% for Ltarp in smth.3 %}
<tr>
<td width='500'> {{Ltarp.0}} </td>

</tr>
{% endfor %}

</table>
{% 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, 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 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-us...@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.

Offline

#4 Jan. 16, 2011 08:27:10

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

list of lists in template


Thanks

On Jan 7, 9:27 am, Chris Matthews <ch...@bbd.co.za> wrote:
> {%  for Ltarp in  smth.3 %}
> SHOULD BE
> {%  for Ltarp in  smth.2 %}
> 'cos Lans only has 3 elements and Ltarp is Lans.
>
> Chris
>
> -----Original Message-----
> From: 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()
> ..
> Lans.append( )
>
> in template.html
> {% if Lans %}
>
> {%  for smth in Lans %}
> <table >
> <tr> <td width='500'> {{smth.0}} </td></tr>
>
>     {%  for Ltarp in  smth.3 %}
>     <tr>
>     <td width='500'> {{Ltarp.0}} </td>
>
>     </tr>
>     {% endfor %}
>
> </table>
> {% 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, 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 athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 24th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support