[Zope] RE: riddle me this Batman, coded copy/paste syntax?
Dr. Ross Lazarus
rossl@med.usyd.edu.au
Sun, 06 Aug 2000 17:37:31 +1000
This code worked fine in 2.1.6 but is broken
(http://classic.zope.org:8080/Collector/1371/view) for me when moving
zclass instances in 2.2.0
However...YMMV, so here it is for what it's worth.
Note that thingstocopyidlist is just a list containing the object ids
you want cloned from sourcefolder into targetfolder and that the
clipboardstuff trick came out of a latenight reading of some python
source
deep in the bowels of zope....
<dtml-with "_.getitem(sourcefolder)">
<dtml-call
"REQUEST.set('clipboardstuff',manage_copyObjects(ids=thingstocopyidlist))">
</dtml-with>
<dtml-with "_.getitem(targetfolder)">
<dtml-call "manage_pasteObjects(cb_copy_data=clipboardstuff)">
</dtml-with>
> The Zope quick reference lists the following methods
> for the stock folder object:
>
> manage_copyObjects(self, ids, [REQUEST, RESPONSE])
> manage_cutObjects(self, ids, [REQUEST])
> manage_delObjects(self, [ids, REQUEST])
> manage_pasteObjects(self, [cb_copy_data, REQUEST])
>
> For the life of me I can't get copy|cut and paste
> to work even for the simplest of examples. I've
> tried snippets like the following (embedded within
> a DTML method in a folder) but to no avail:
>
> <dtml-call "manage_copyObjects(['subobjectid']">
> <dtml-call "manage_pasteObjects()">
>
> <dtml-call "manage_copyObjects([_['subobjectid']])">
> <dtml-call "manage_pasteObjects()">
>
> Can someone shed some light on my misunderstanding?
>
> Cheers,
> Darran.