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

Δημήτρης Ανδρακάκης Δημήτρης Ανδρακάκης"
Wed, 28 Mar 2001 00:16:18 +0300


(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