Commit f1e38201 authored by Romain Courteaud's avatar Romain Courteaud

Add _setFile method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9365 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4d4655e4
...@@ -78,6 +78,15 @@ class Image (Base, Photo): ...@@ -78,6 +78,15 @@ class Image (Base, Photo):
elif self.store == 'ExtImage': from Products.Photo.ExtPhotoImage import PhotoImage elif self.store == 'ExtImage': from Products.Photo.ExtPhotoImage import PhotoImage
self._original = PhotoImage(self.id, self.title, path=self.absolute_url(1)) self._original = PhotoImage(self.id, self.title, path=self.absolute_url(1))
security.declarePrivate('_setFile')
def _setFile(self, file):
"""
This is used to set files
"""
Photo.manage_editPhoto(self, file=file)
self.manage_purgeDisplays()
security.declarePrivate('_edit') security.declarePrivate('_edit')
def _edit(self, **kw): def _edit(self, **kw):
""" """
...@@ -87,8 +96,7 @@ class Image (Base, Photo): ...@@ -87,8 +96,7 @@ class Image (Base, Photo):
if kw.has_key('file'): if kw.has_key('file'):
file = kw.get('file') file = kw.get('file')
precondition = kw.get('precondition') precondition = kw.get('precondition')
Photo.manage_editPhoto(self, file=file) self._setFile(file)
self.manage_purgeDisplays()
del kw['file'] del kw['file']
Base._edit(self, **kw) Base._edit(self, **kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment