[Zope] (no subject)

Eric Walstad Eric@Walstads.net
Tue, 17 Oct 2000 08:25:39 -0700


Hi Rob,
I'm a newbie, but I just finished doing what you are trying to do.  Here's
how I did it:
Product name: NewsItem
    ZClass: CNewsItem
        Property Sheet: NewsProperties

In the BuildNews dtml method:
<dtml-call "REQUEST.set('ts', ZopeTime())">
<dtml-call "REQUEST.set('id', _.str(_.int(ts)))">

<dtml-with "manage_addProduct['NewsItem']">
  <dtml-call "CNewsItem_add(_.None, _, NoRedir=1)">
</dtml-with>

  <dtml-with "_.getitem(REQUEST['id']).propertysheets.NewsProperties">
    <dtml-call "manage_changeProperties({
      'PostedBy' : REQUEST['PostedBy'],
      'email' : REQUEST['email'],
      'Title' : REQUEST['Title'],
      'Content' : REQUEST['Content'],
      'Expires' : REQUEST['Expires'],
      'IconPath'  : REQUEST['IconPath'],
      'DetailURL'  : REQUEST['DetailURL'],
      'DetailDescription'  : REQUEST['DetailDescription']})">
  </dtml-with>

<dtml-call "RESPONSE.redirect(URL2)">

Hope it helps.

Eric.

// I want to create a large number of properties for a Zclass.
// My Zclass has a propertysheet named Schedule.
//
// I've tried stuff like this:
//
// <dtml-with propertysheets>
// <dtml-with common>
// <dtml-with Schedule>
// manage_addProperty(name='foo', value='bar', type='string')
// </dtml-with>
// </dtml-with>
// </dtml-with>
//
//
// The <dtml-with>'s don't get an error, so I must be popping namespaces on
// properly.  But the manage_addProperty always results in:
//
// invalid attribute name, "manage_addproperty(name", for tag <dtml-call
// manage_addProperty(name='foo', value='bar', type='string')>, on
// line 10 of makeSched
//
//
// =Rob======
// ====J=====
// =====Roos=