[ZPT] ZPT in ZSQL Method

Geir Bækholt Geir Bækholt
Sun, 26 Jan 2003 22:47:57 +0100


Hello Corey, 

Sunday, January 26, 2003, 10:33:05 PM, you wrote:

> As an aside, I'd like to pull a resulting value out of a Z SQL Method without
> using tal:repeat.  Is this possible?  The ZSQL Method in question only ever
> returns a single value.

> I'd like to do something like:
>    <p><span tal:replace="here/select_CompanyID('CompanyId')">CompanyId</span></p>

<p tal:content="python:here.select_CompanyID()[0].CompanyId">CompanyId</p>

would work (if select_CompanyID don't need parameters passed in..)

> Rather than:

>    <span tal:repeat="item here/select_CompanyID">
>       <p><span tal:replace="item/CompanyId">CompanyId</span></p>
>   </span>

why not just write this one as :

<p tal:repeat="item here/select_CompanyID"
   tal:content="item/CompanyId">
   CompanyID
</p>
which is even valid ;) - you cannot have ps within spans in valid HTML
(this has nothing to do with ZPT ;)   )

- and as there is really no need for all those spans anyway, why not
just dump them ?


-- 
Geir Bækholt        geir@funcom.com
Application/HCI-developer
Product Operations
Funcom Oslo