[Zope] Re: Dynamic class from python script (?)

Dimitris Koukis koukis at vtrip.net
Mon Feb 26 18:17:52 EST 2007




Tres,

thank you very much for your quick reply. Indeed it works with the
mapping parameter, but the application has a large number of files and i
was hoping that i wouldn't have to change them all ;) On the other hand
it is a simple change, i can do that with a script if there is no there
solution.

Thanx again for your help :)

Tres Seaver wrote:
> Dimitris Koukis wrote:
>>> Dear Zopistas,
>>>
>>> i have an old zope application that present data from a database in such
>>> a manner
>>> <dtml-in "sql_methods.select_user()">
>>> <dtml-var firstname><dtml-var lastname>
>>> </dtml-in>
>>>
>>> I had to change the methods that returned data from the database, and it
>>> is no longer possible to return data directly from zsql methods. Instead
>>> i read them in a script, perform some processing and return a dictionary
>>> with exactly the same mappings. I thought the application would work
>>> without any change but it seems this is not the case (variables in
>>> dtml-in can not be found, kinda makes sense now, the dictionary values
>>> are not properties...).
> 
> Try the 'mapping' parameter for 'dtml-in'::
> 
>   <dtml-in name="your_python_script" mapping>
>    <dmtl-var name="firstname"><dtml-var name="lastname">
>   </dtml-in>
> 
> 
> Tres.
> --
> ===================================================================
> Tres Seaver          +1 540-429-0999          tseaver at palladion.com
> Palladion Software   "Excellence by Design"    http://palladion.com

_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

-- 
Dimitris Koukis
Software Engineer
koukis at vtrip.net





More information about the Zope mailing list