[Zope] Namespace confusion

Joel Burton jburton@scw.org
Tue, 13 Mar 2001 19:07:43 -0500 (EST)


I have a ZClass _add method (for JBook), which adds an instance of the
class.

This instance should automatically have an instance of another class
(JDiscussFolder) added as a child.

I am handling this as


<dtml-with "JBook.createInObjectManager(REQUEST['title'], REQUEST)">

  <dtml-call "propertysheets.common.manage_editProperties(REQUEST)">


   <adtml-call "REQUEST.set('id', 'discuss')">
   <adtml-call "REQUEST.set('title', 'Discussion Area')">

    <dtml-with "manage_addProduct['JDiscuss']">
       <dtml-call "JDiscuss_Folder_add( _.None, _)">
    </dtml-with>


</dtml-with>



which adds the JBook (using the form-derived title as the id), and adds
the properties filled out on the add form.

It also adds the JDiscussItem, where I want to set the id and title to
something else. I've done this by REQUEST.set, which works fine.

The problem is that it overwrites the current values of title and id, so I
can refer later to the book title and id.

I've tried to do this like wrap the JDiscuss_add in <dtml-let> or
<dtml-with> bands to supply a namespace for the title and id, but haven't
been successful. For example, I thought that

  <dtml-with " { 'id': 'discuss', 'title': 'Discussion area' }" mapping>

    .. call to add the discuss folder

  </dtml>

would work, but it doesn't. (No error, just doesn't use the new id or
title.)

How can I pass in these variables w/o resorting to the overwriting
REQUEST.set calls?


Thanks!


-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington