[Zope] passing positional paramaters

Ivan Stout aibanhamano at gmail.com
Fri Mar 11 01:33:27 EST 2005


Dieter,

Thanks, it is a Z SQL method . . . I will get rid of the positional
place holders.

Cliff,

Thanks for the response.

I did the following:	

DTML METHOD file:

<html>
<dtml-var name><br>
<dtml-var doclang>
<form action="parsegettranslation.py" method="get">
 <dtml-in expr="gettransdoc(name=name,doclang=doclang)">  #changed here
 <br>
 <dtml-var ordering> <dtml-var content>

gettransdoc Z SQL Method file:

(ARGUMENTS:name doclang)

select *
from document
where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar
doclang type=string>

This is what I get:

"Error Type: NameError
Error Value: 'DOCLANG': ambiguous or unknown attribute"

However, if I add a single quote to the DTML Method, like this:
 <dtml-in expr="gettransdoc(name='name',doclang='doclang')">

I do not get an error, but I do not get my query results either . . .
Are the single
quotes getting literally passed to the query or something?



On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford at ed.ac.uk> wrote:
> It is not clear to me why you would pass None parameters to a select
> query. Typically your query would have named arguments (name and
> doclang) like this:
> 
> select * from yourTable where name=<dtml-sqlvar name type=string>
> and doclang=<dtml-sqlvar doclang type=string>
> 
> Leave out the last line if you don't want to select and doclang.
> 
> Then call the query like this:
> 
> <dtml-in expr="gettransdoc(name=name,doclang=doclang)">
> <dtml-var ordering> <dtml-var content><br>
> </dtml-in>
> 
> Cliff
> 
> Ivan Stout wrote:
> > Greetings. I am trying to create an open source communal translation
> > zope product thingy and have run into a snag. I had everything
> > working, but then I realized that I needed to distinguish between what
> > the language that the original document bein translated was in, which
> > required passing an additional paramater to my query to gadfly. Well,
> > this supposedly "broke the paramater chain" requiring me to explicitly
> > add positional paramaters. The problem is, though I no longer get an
> > error, no results are returned from my table. The paramaters are
> > filtering the query, so I believe that my values are getting altered
> > in some way that is causing them to not match anything. Here is what I
> > suspect is causing me trouble . . .(the "----------------->" part):
> >
> > <dtml-var name><br>
> > <dtml-var doclang>
> > <form action="parsegettranslation.py" method="get">
> > -----------> <dtml-in
> > expr="gettransdoc(_.None,_,name='name',doclang='doclang')">
> >  <br>
> >  <dtml-var ordering> <dtml-var content>
> >  <br>
> >
> > Thanks!
> > _______________________________________________
> > Zope maillist  -  Zope at 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 )
>


More information about the Zope mailing list