[Zope] Guess what? namespace issues!

Peter Bengtsson mail@peterbe.com
Mon, 12 May 2003 15:55:17 +0100


At 10:08 2003-05-12 -0400, jwsacksteder@ramprecision.com wrote:
>I have two DTML methods and a one ZSQL method in a folder. I am apparently
>misunderstanding how to access the ZSQL method.
>
>
>The top-level DTML method contains references in the following form:
>
>         <dtml-var expr="show_detail(machine='D340')">

Maik in the other email is right, but it's advisable that you don't call a 
template from a template. Bad design.
Consider using Python Scripts instead. Always favouring scripts instead of 
DTML will help you keep the templates as simple and HTMLish as possible.

Peter

>The show_detail DTML method exists to wrap the ZSQL method and convert to a
>human readable form. It currently looks like this:
>
>         <dtml-in expr="get_sum_sql(_)">
>            <dtml-var subtotal null="0">
>         <dtml-else>
>            0
>         </dtml-in>
>
>The ZSQL method accepts a single parameter called 'machine'. For each
>parameter, it will produce a single result.
>
>
>This makes sense to me. Unhappily, it does not work. It produces the
>following error:
>
>         Error Type: NameError
>       Error Value: global name 'get_sum_sql' is not defined
>
>I'm sure I'm missing the obvious here...
>
>
>
>
>
>
>_______________________________________________
>Zope maillist  -  Zope@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 )