[Zope] Cloning a ZClass-Instance

Dieter Maurer dieter@handshake.de
Tue, 7 Nov 2000 22:20:03 +0100 (CET)


brocken22@gmx.de writes:
 > Hallo,
 > 'news'is a zclass and when I'm using a hardcoded value for x it's working.
 > 
 > that's the cloning-method:
 > ------------------------------
 > <dtml-in "objectValues(['news'])">
 > <dtml-let x=sequence-item>
 > 
 > <dtml-if "now.isCurrentDay()">
 >  <dtml- call "manage_clone(_.getitem('x',0),'firstclone', [REQUEST])"> 
 >                 
 > Copied!
 > <dtml-else>
 > Not needed to clone!!
 > </dtml-if>
 > </dtml-let>
 > </dtml-in>
 > ------------------------------
 > And the traceback:
 > ---------------
 > The object one  does not support this operation 
Whereever you use a name in DTML, the referenced object
is called, if it is callable.

In your case, you use the name "sequence-item" in the "dtml-let".
Apparently, your "news" instances are callable.
If I am right, then "x" is a string (which of cause does not
support cloning).

Try:

  <dtml-let x="_.getitem('sequence-item')">
    ....
  </dtml-let>


Dieter