[Zope] Tree tag and SQL methods

Thomas Weiner weiner@tu-harburg.de
Thu, 29 Jul 1999 20:00:18 +0200


"Phillip J. Eby" schrieb:
> 
> At 06:32 PM 7/29/99 +0200, Thomas Weiner wrote:
> >
> ><!--#with "_.namespace(sqid=0, param=1)"-->
> >  <!--#tree id=sqid branches_expr="adr_suche3(sqid=sqid, param=param,
> >  Crit1_and_or=Crit1_and_or)" single=0-->
> >
> >Crit1_and_or is a list coming from a request, which I want to use in the
> >SQL method ('adr_suche3').
> >
> >The tree works fine in the first level.
> >With the second level I receive an 'Error value: Crit1_and_or'. The
> >Error value also occurs if I try to give Crit1_and_or a new value in the
> >SQL method (e.g. 'select *, '' as Crit1_and_or').
> >
> >Without this parameter tree and sql-method do, what they should.
> >
> >What I'm doing wrong here?
> 
> Selecting '' as Crit1_and_or will make it a string, not a list.  So if your
> code relies on Crit1_and_or being a list, it will fail.

hmmm .. 
select *, [''] as Crit1_and_or gives a sql(odbc?-) error.

I need Crit1_and_or as a list only for the select code, that builds the
first level of the tree (and this 'select' receives 'Crit1_and_or'
correctly and completely). For the further selects I don't need it.
Passing a string element to a sql method, that actually waits for a list
element, seems to work (in my case e.g. adr_suche3(sqid=sqid,
param=param,  Crit1_and_or=''), if the element is not used in the code.

What I don't understand: Crit1_and_or belongs to the namespace of the
dtml method. The tree tag knows it with the first call but no longer
with further calls?

thanks, thomas
-- 
fon: ++49 (0)40 42878 3781
fax: ++49 (0)40 42878 2728