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?
[...]
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)
Can you provide the entire Traceback, so I can see at which point in your method Zope bailed? Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
On Sat, Apr 22, 2000 at 12:58:15PM -0500, Stephan Richter wrote:
Can you provide the entire Traceback, so I can see at which point in your method Zope bailed?
Traceback (innermost last): File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/lib/zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: PuploadMenu) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: PuploadMenu) File /usr/lib/zope/lib/python/Products/ExternalMethod/ExternalMethod.py, line 248, in __call__ (Object: PuploadMenu) (Info: ((<Folder instance at 858c8f8>, <h3>form</h3><table><tr valign="top" align="left"><th>SUBMIT</th><td>Nuovo Articolo</td></tr><tr valign="top" align="left"><th [HUGE LINE TRUNCATED] ^^^^^^^^^^^^^^^^^^^^^ File /var/lib/zope/Extensions/upload.py, line 128, in uploadMenu (Object: ElementWithAttributes) File /var/lib/zope/Extensions/upload.py, line 57, in NuovoArticolo (Object: ElementWithAttributes) 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) Thanks..
File /var/lib/zope/Extensions/upload.py, line 128, in uploadMenu (Object: ElementWithAttributes) File /var/lib/zope/Extensions/upload.py, line 57, in NuovoArticolo (Object: ElementWithAttributes) 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)
Can you send me your upload.py file? It seems like you wrote it. PS: Zope should not be installed under /usr/lib/zope and /var/lib/zope. I saw that the other time on another server and out of my experience these are the worst places to install it. If you used a package, I would strongly suggest not to use it any more. Here some common places for different systems: /usr/zope (a good place in general) /usr/local/zope (Linux standard like) /opt/zope (Solaris standard) I would not mind, if you put the var/ directory under /var/zope Which one you choose is up to you. There is always a lot of discussion going on, which one the best is, but the fact is that every sys admin has his/her own standard. Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
On Sat, Apr 22, 2000 at 03:14:49PM -0500, Stephan Richter wrote:
Can you send me your upload.py file? It seems like you wrote it.
Here it comes. It smells "newbie" all over, and it's work in progress.
PS: Zope should not be installed under /usr/lib/zope and /var/lib/zope.
We should tell that to the debian mantainer (flight@debian.org), I use a stock potato.
Can you send me your upload.py file? It seems like you wrote it.
Here it comes. It smells "newbie" all over, and it's work in progress.
I'll have a look now.
PS: Zope should not be installed under /usr/lib/zope and /var/lib/zope.
We should tell that to the debian mantainer (flight@debian.org), I use a stock potato.
Yeah, that's right. I saw that on a Debian system. Mmmh, I hope he is on the Zope mailing list. regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
On Sat, Apr 22, 2000 at 07:53:54PM -0500, Stephan Richter wrote:
We should tell that to the debian mantainer (flight@debian.org), I use a stock potato.
Yeah, that's right. I saw that on a Debian system. Mmmh, I hope he is on the Zope mailing list.
By the Debian guidelines, /usr could be mounted read-only. Additional products and external methods may thus only go in /var.
On Sat, Apr 22, 2000 at 07:53:54PM -0500, Stephan Richter wrote:
PS: Zope should not be installed under /usr/lib/zope and /var/lib/zope.
We should tell that to the debian mantainer (flight@debian.org), I use a stock potato.
Yeah, that's right. I saw that on a Debian system. Mmmh, I hope he is on the Zope mailing list.
I am. Well, indeed the Debian Zope package installs Zope with SOFTWARE_HOME=/usr/lib/zope and INSTANCE_HOME=/var/lib/zope. This was done to comply with the Filesystem Hierarchy Standard (FHS), which is mandatory for Debian packages. Some principles of FHS are separation of mutable and static data (/var vs. /usr), separation of architecture-dependent and independent data (e.g. /usr/lib vs. /usr/share) and separation of local and vendor-provided data (/usr vs. /usr/local resp. /opt). Debian's interpretation of this is that /usr (and /var) is the domain of the Debian package manager and shouldn't be touched by a local sysadmin or user. OTOH, Debian packages should reserve /usr/local for local data as installed by the local sysadmin. All of this is described in the Debian Policy document (http://www.debian.org/doc/debian-policy/). If any problems arise out of this, please mail me, or report them as a bug with the Debian Bug Tracking system (http://bugs.debian.org/). I'd like to stress that Zope supports this kind of installation scheme. Gregor
Okay, I had a look. Do you have a ZClass where the methods in upload.py are External Methods? After you sent me the traceback did you make changes to upload.py, because the traceback does not seem to work out right. Unfortunately, without having all the code it is hard to see how everything is supposed to work. I actually do not understand where "self" is coming from, since it is causing the problem. Somewhere in your code "self" is set to a string (the filename of the picture) and not to the object itself. The first thing I would check is the place you call uploadMenu and see, whether you pass anything as "self". Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
On Sun, Apr 23, 2000 at 01:06:39PM -0500, Stephan Richter wrote: [...]
Unfortunately, without having all the code it is hard to see how everything is supposed to work.
[...] I give you my excuses for having caused you trouble, I now see that I cannot paste an Image within a ZClass instance that inherits from ObjectManager, not even within the management interface. If it inherits from Folder, the paste works (from the management interface, at least). Tomorrow I'm leaving for a week-long vacation, so I'll look into it with a clearer mind. Thanks again to you, and to the Zope crew. It looks like web programming isn't as bad as they say after all...
Thanks again to you, and to the Zope crew. It looks like web programming isn't as bad as they say after all...
Well, I am glad you figured it out. Sometimes Zope needs a while of thinking, before one can understand it. I guess that is what they mean with understanding the "Zen of Zope". :) Have fun on your trip. Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
participants (3)
-
Gregor Hoffleit -
Marco Mariani -
Stephan Richter