Iterate over keys value

thorshand <[email protected]> Wed, 4 Feb 2015 18:13:03 +0100 (CET)
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <29871172.1190188.1423069983605.JavaMail.www@wsfrf1235>
--===============3091505326458510641==
Content-Type: multipart/alternative;
	boundary="----=_Part_1190187_23948457.1423069983602"

------=_Part_1190187_23948457.1423069983602
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

Is it possible to iterate over a key value, like :=20

<% foreach c in comment({id_table =3D 'Blog'}) %>
=C2=A0=C2=A0 <% c.date %> <% c.id %>
<% end %>

comment is a resulset of dbix search with columns : id, id_table, name, dat=
e, ...=20
I would like to make one dbi request (don't include where clause in results=
et) to do this after :

<% foreach table in ('Blog', 'Wiki' ...) %>
=C2=A0=C2=A0 <% foreach c in comment({id_table =3D table}) %>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <% c.date %> <% c.id %>
=C2=A0=C2=A0 <% end %>
<% end %>

Thanks

------=_Part_1190187_23948457.1423069983602
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi,<br><br>Is it possible to iterate over a key value, like : <br><br>&lt;% foreach c in comment({id_table = 'Blog'}) %&gt;<br>&nbsp;&nbsp; &lt;% c.date %&gt; &lt;% c.id %&gt;<br>&lt;% end %&gt;<br><br>comment is a resulset of dbix search with columns : id, id_table, name, date, ... <br>I would like to make one dbi request (don't include where clause in resultset) to do this after :<br><br>&lt;% foreach table in ('Blog', 'Wiki' ...) %&gt;<br>&nbsp;&nbsp; &lt;% foreach c in comment({id_table = table}) %&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;% c.date %&gt; &lt;% c.id %&gt;<br>&nbsp;&nbsp; &lt;% end %&gt;<br>&lt;% end %&gt;<br><br>Thanks<br>
------=_Part_1190187_23948457.1423069983602--


--===============3091505326458510641==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

--===============3091505326458510641==--