[Zope] crazy result

Kate Legere klegere at kfpl.ca
Wed Dec 3 16:10:35 EST 2003


This is insane ... I have an example (using DTML) of this working perfectly
and an example (using TAL) where it doesn't work at all:

I have a DTML method which is a form that allows users to add their name
(staff_name), some text (description) and a link (link_url)

<p>Details: <br>
  <textarea name="description" rows="10" cols="60"></textarea>
</p>

---
on submit it calls a DTML method named addEntryAction which calls a python
method 'add'

<dtml-call expr="add(staff_name, link_url, description)">

---
the python method creates a file and adds the description (and the other
parameters)

# create a unique file id
id='message_%d' % len(context.objectIds())

# create the document
context.manage_addProduct['OFSP'].manage_addFile(id,
                                         title="", file=description)

-----
then you get booted back to the page that iterates through all the postings.
this is a TAL file called index.html

          <span tal:condition="python: item.meta_type == 'File'">
              <b tal:content="item/staff_name">  name
              </b>
                wrote on

                <span tal:define="mtime item/bobobase_modification_time"
                   tal:content="python:mtime.strftime('%d/%m/%Y
%H:%M')">date
                </span>

                and added the link: <b
tal:content="item/link_url">link</b><br>
                saying

                <b tal:define="pss modules/Products/PythonScripts/standard"
                 tal:content="python: pss.newline_to_br(item.description)">
news
                </b>
                <hr>
           </span>

------
Everything works and displays except description which displays as the word
description. When I add an item and then go back and look at the file
created - the text is always 'description' no matter what I typed.

What's going on here???

Kate







More information about the Zope mailing list