[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 = .
>
> You also have a ZSQL method, new_scheme, with parameter new_product and
> scheme.
>
> Observation:
>
>
>
>
>
> 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.
The explantion:
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):
is equivalent to .
Your , however, has placed the fields into the
namespace "_" and not in the REQUEST object.
You cannot use 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.
or
2.
I prefered 1. in my solution.
Dieter
___
Zope maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )