[ZPT] using tal:attributes with <option> select and ZSQL.

Luis Lavena luislavena@hotmail.com
Thu, 30 May 2002 01:58:11 -0300


Hello, some comparing isn't working, been trying tis a few ours and can't
get it to work, have checked and compared the code with other working
tal:attributes, but didn't work...

here is the code snippet:

              <td>
                <select class="marcotxt"
name="params.idgrillasenales:int:record" size="1"
tal:condition="listacanales">
                  <tal:dummy tal:repeat="item listacanales">
                  <option value="1" tal:attributes="selected
python:item.idgrillasenales == params['idgrillasenales'];value
item/idgrillasenales" tal:content="item/nombrecanal">Canal
                  UNO</option>
                  </tal:dummy>
                </select>
              </td>

I have been trying to use tal:repeat to fill a <select> with options, based
on that the value of each option will be item.idgrillasenales and the
content of it will be item.nombrecanal.

Until that, the add page everything works Ok, but the problem raises on the
modify page, where is supposed that the list will pre-select the already
stored and choosed value, but it didn't.

have tried:

tal:attributes="select python:path('item/idgrillasenales') ==
path('params/idgrillasenales')"
tal:attributes="select python:item['idgrillasenales'] ==
params['idgrillasenales']"

but don't work either.

listacanales is a zsqlmethod, and params is a dict returned from a PyScript
which parses the current record info.

Any ideas?

Thanks in advance,

Luis Lavena