Re: [Zope] Precondition on images saved in a localfs folder
Bruno Grampa wrote at 2006-1-10 23:42 +0100: >if i upload an image in the ZOBD as a file i have the precondition if i >do the same in the localfs folder no. Do you know why? The files in an "localfs" folder are only temporarily wrapped as Zope objects. The wrapper is destroyed at the request end. You cannot store persistent data on them (e.g. a precondition). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Precondition on images saved in a localfs folder
if i upload an image in the ZOBD as a file i have the precondition if i do the same in the localfs folder no. Do you know why? It seems LocalFs will always recognise the file uploaded as an image... Zope will set the uploaded file type unless you do it explicity before you save the object: eg. folder.manage_addFile(id=thisId, file=filedata, title=afile, content_type=contentType) set contentType to what you want. hth Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Precondition
On Sun, 6 Aug 2000, Martijn Pieters wrote: > Precondition > > Allows you to specify a precondition for the File. A precondition is a > method or document which is executed before the File is viewed or > downloaded. If the precondition raises an exception then the File cannot > be viewed. > > This is from the Help page presented when you click the 'help' button on the > 'Edit' tab of a 'File' object. I knew I'd read it somewhere! First I ran through the help menu, but I must have looked at File/Image Add and missed File/Image Edit. Then I looked at an Image (I had no File objects handy), and when I saw that the help tab for the Edit, page had no description of precondition, and indeed that there was no way to set it, I figured the docs for it must only be in the API section. But the API section does not discuss *any* of the call paramters. So I thought it was undocumented. Since the code supports preconditions on an Image, is this an interface error or a design decision (the latter seems more likely)? If it's a design decision, shouldn't precondition still be documented in the Image api help doc? This is an example of a systematic problem with the (very useful ) help docs as they stand: if the API docs implicitly assume that the parameters are documented in the corresponding management interface panel then there should at least by a cross link; and if there are sometimes parameters that are *not* documented on the manage page, then that needs to be taken into account somehow. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Precondition
On Fri, Aug 04, 2000 at 10:11:55PM -0400, R. David Murray wrote: > On Fri, 4 Aug 2000, RC Compaan wrote: > > What does the "Precondition" property of the file class refer to? > > As far as I can tell from a quick scan of the source, the precondition > is an object that is called just before the file object is rendered. > It can raise an exception, in which case the object will not get > rendered. I could swear I read that documented somewhere, but I > can't find it. Someone should submit a doc patch for the API help > pane. I'd do it, but I haven't gotten around to learning how the > help system works yet so I don't know what file to patch . Precondition Allows you to specify a precondition for the File. A precondition is a method or document which is executed before the File is viewed or downloaded. If the precondition raises an exception then the File cannot be viewed. This is from the Help page presented when you click the 'help' button on the 'Edit' tab of a 'File' object. -- Martijn Pieters | Software Engineermailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | ZopeStudio: http://www.zope.org/Products/ZopeStudio - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Precondition
On Fri, 4 Aug 2000, RC Compaan wrote: > What does the "Precondition" property of the file class refer to? As far as I can tell from a quick scan of the source, the precondition is an object that is called just before the file object is rendered. It can raise an exception, in which case the object will not get rendered. I could swear I read that documented somewhere, but I can't find it. Someone should submit a doc patch for the API help pane. I'd do it, but I haven't gotten around to learning how the help system works yet so I don't know what file to patch . --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )