[Zope] manage_clone issue

Marco Mariani m.mariani@imola.nettuno.it
Sat, 22 Apr 2000 18:02:01 +0200


I've got a nice (!) ArtClass, subclassed from ObjectManager.

I'd like to create an instance of ArtClass that contains a few Images, then
(eventually) delete the Images.



I get the following:


!              The object MVC-009F.JPG does not support this operation 

[...]

File /usr/lib/zope/lib/python/OFS/CopySupport.py, line 284, in manage_clone
  (Object: art_1)
File /usr/lib/zope/lib/python/OFS/CopySupport.py, line 374, in _verifyObjectPaste
  (Object: art_1)
Copy Error: (see above)




This is the code:




def NuovoArticolo(self,REQUEST,RESPONSE):
    r=''
 
    group = REQUEST.form.get('group')           # list of images to be added
 
    next_art = self['next_articolo']            # next article ID: property of this folder

    upload = self.upload.this()                 # upload folder contains the images

    id = 'art_%s'%next_art
    newob=upload.Control_Panel.Products.MArticolo.ArtClass(id)
    newob.id=id
 
    upload._setObject(id,newob)

    r=r+ 'Articolo %s aggiunto.' % next_art
 
    next_art = next_art + 1
 
    next_foto = self['next_foto']               # next image ID
 
    for i in group:
        newob.manage_clone(upload[i],'foto_%s'%next_foto)
        newob[next_foto].manage_changeProperties({'filename': i})   # store old filename
        next_foto = next_foto + 1
 
    self.manage_changeProperties({'next_articolo': next_art})
    self.manage_changeProperties({'next_foto': next_foto})
 
    return r






What am I doing wrong?