[Zope] SQL call inside <dtml-let> (Somebody help please I'm goin' INSANE !!!!!!!!!)

Laurie Nason laurien@tiger.bcm.tmc.edu
Tue, 27 Mar 2001 15:24:34 -0600


Try changing the call statement to
  <dtml-call
"sqlInsertAnnouncement(link=link,ann_title=ann_title,comment=comment,
category=category)">
I spent quite a while with this problem then discovered that the problem
occurs due to the namespaces not communicating to  each other. So explicitly
call the function/SQL method with the arguments as above.
HTH
Laurie

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Δημήτρης
Ανδρακάκης
Sent: Tuesday, March 27, 2001 3:16 PM
To: zope@zope.org
Subject: [Zope] SQL call inside <dtml-let> (Somebody help please I'm goin'
INSANE !!!!!!!!!)


(I think the subject says it all :-)

So I've got this dtml method, which is called
by a form. It used to be something simple like:

<dtml-var standard_html_header>

<dtml-call sqlInsertAnnouncement>
<h2>Thank you</h2>

<dtml-var standard_html_footer>

Now I want to make it more sofisticated, so that
the user enters less data. I came up with this:

<dtml-var standard_html_header>

<dtml-let date="_.str(ZopeTime())"
          folderid="date[5:7]+date[2:4]"
          fileid="file.filename[_.max(_.string.rfind(file.filename, '/'),
_.string.rfind(file.filename, '\\'),
_.string.rfind(file.filename, ':'))+1:]"
          link="folderid+'/'+fileid">

    <dtml-comment>
    <dtml-call sqlInsertAnnouncement>
    </dtml-comment>

    <dtml-var link><br>
    <dtml-var ann_title><br>
    <dtml-var comment><br>
    <dtml-var category><br>

</dtml-let>

[there are more stuff here, but they work fine... what they do is upload a
file]

<dtml-var standard_html_footer>

Notice the <comment>s around the sql call. Once I remove them. I get a "Bad
Request". I've put
the <dtml-var>s so I can see if the vars the sql method requires (link,
ann_title, comment, category)
are ok --and they are.

I've tested it 1000s of times, it all works fine except for the <dtml-call>.
Is it some bug ? Does the
call not work inside <dtml-let> ? Is it something else I'm missing ? Any
guru please, it's driven me crazy !

I'm using zope 2.2.2 behind apache 1.3 (.19 I think) and RH 6.2.

Dimitris @ Nuclear



_______________________________________________
Zope maillist  -  Zope@zope.org
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 )