[Zope] How to keep table aliases apart in an ZSQL method

Ernst Eeldert Eeeldert@landis.nl
Fri, 20 Jul 2001 22:00:54 +0100


> Not that what matters is that you have 'deptno' defined as a 
> parameter of
> the ZSQL method. The fact that, in your table, the field is 
> "deptno" is
> just a coincedence. The field in the table is referenced as 
> "e.deptno" is
> fine--but that's the name of the parameter for the ZSQL 
> method. To make is
> clearer:

The problem is that I need to use the following dtml statement to make the
parameter optional:

	<dtml-sqltest e.deptno op=eq type=int optional>

I can't use 'deptno' as the name, because the then the db doesn't know which
deptno column I want to filter on. So then I need to use 'e.deptno' as the
parameter name.

The 'dictionary' syntax you suggested for the <dtml-in> statement made it
accept the e.deptno as a parameter. So now I use this:

<dtml-in expr="emp_list({'e.deptno':10})">

which works like a charm.

Thanks alot.

Ernst Eeldert

PS. this little conversation between Joel and can be seen as 1 vote against
a seperate 'newbie-list'. One thing I have to say to other newbies: if you
solve your problem slightly different then was suggested by a guru, don't
hesitate to reply with the full solution. This way, we make the mailing list
an even more valuable resource for other newbies.