[EMAIL PROTECTED] writes:
> Suppose, you have a database, items, that has fields product and scheme.
> You are processing a form that has field old_product and new_product.
> You have a ZSQL method, get_scheme, with parameter old_product and body
> select * from items where product = <dtml-sqlvar old_product type=string>.
> You also have a ZSQL method, new_scheme, with parameter new_product and
> <dtml-in get_scheme>
> <dtml-call new_scheme>
> fails, with message
> Zope Error
> Zope has encountered an error while publishing this resource.
> Error Type: NameError
> Error Value: scheme
I can across the same thing yesterday.
SQL methods are much more stupid than DTML methods!
If used in the way you do it, SQL methods look only
in the REQUEST object and not in the namespace.
This means (if called from a WEB request, i.e. REQUEST is defined):
<dtml-call new_scheme> is equivalent to <dtml-call "new_scheme(REQUEST)">.
Your <dtml-in>, however, has placed the fields into the
namespace "_" and not in the REQUEST object.
You cannot use <dtml-call "new_scheme(_)"> either, because
SQL methods require a "get" method from their first parameter
("_" does not have it).
For the moment, you have to use on of these ways:
1. <dtml-call "new_scheme(new_product=new_product, scheme=scheme)">
2. <dtml-call "REQUEST.set('new_product',new_product)">
I prefered 1. in my solution.
Zope maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -