[Zope] Having problems with python script

Laura McCord Laura.McCord at doucet-austin.com
Fri Sep 17 15:47:39 EDT 2004


I have posted this question a few times and I am still struggling on
finding the correct way to pass a parameter. 

This is what I am doing. I am getting results from a zsql method
(results here/view_users) and I need to pass a value from that batch
(result/username) to a python script

This is what it looks like:

  <div tal:define="results here/view_users;
                   batch python:here.getBatch(results)">
  .
  .
  .
   <div tal:repeat="result batch"
    <div tal:define="userName result/username">
     <div tal:replace="python:here.ldapInfo(userName)"/>   -----> Does
not work!!!

If I manually insert a value it works perfectly:
 
 <div tal:define="userName python:'lmccord'">
 <div tal:replace="python:here.ldapInfo(userName)"/>
                  or 
 <div tal:replace="python:here.ldapInfo('lmccord')"/>

If I display the value of userName I get this:

 <div tal:content="userName"/> ---> lmccord

So, what is the problem with passing values derived from a zsql
method/database

Thanks. :(


More information about the Zope mailing list