[Zope-Checkins] CVS: Zope/lib/python/OFS - Image.py:1.132

Brian Lloyd brian@digicool.com
Wed, 17 Oct 2001 10:46:18 -0400


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv27884

Modified Files:
	Image.py 
Log Message:
Added image preview on Image edit form; Added Web form editing for File 
object content if the content is a text type and under 64K; updated help
files.


=== Zope/lib/python/OFS/Image.py 1.131 => 1.132 ===
         self.http__refreshEtag()
 
-    def manage_edit(self, title, content_type, precondition='', REQUEST=None):
+    def manage_edit(self, title, content_type, precondition='',
+                    filedata=None, REQUEST=None):
         """
         Changes the title and content type attributes of the File or Image.
         """
@@ -454,7 +455,10 @@
         self.content_type=str(content_type)
         if precondition: self.precondition=str(precondition)
         elif self.precondition: del self.precondition
-        self.ZCacheable_invalidate()
+        if filedata is not None:
+            self.update_data(filedata, content_type, len(filedata))
+        else:
+            self.ZCacheable_invalidate()
         if REQUEST:
             message="Saved changes."
             return self.manage_main(self,REQUEST,manage_tabs_message=message)