version 1.79, 2007/08/31 14:22:52
|
version 1.80, 2007/09/03 11:10:04
|
Line 1537 def manage_addCDLIFileObject(self,id,vC=
|
Line 1537 def manage_addCDLIFileObject(self,id,vC=
|
|
|
# First, we create the file without data: |
# First, we create the file without data: |
self._setObject(id, CDLIFileObject(id,title,'',content_type, precondition)) |
self._setObject(id, CDLIFileObject(id,title,'',content_type, precondition)) |
self._getOb(id).versionComment=str(vC) |
fob = self._getOb(id) |
self._getOb(id).time=time.localtime() |
fob.versionComment=str(vC) |
|
fob.time=time.localtime() |
setattr(self._getOb(id),'author',author) |
setattr(fob,'author',author) |
|
|
|
|
# Now we "upload" the data. By doing this in two steps, we |
# Now we "upload" the data. By doing this in two steps, we |
# can use a database trick to make the upload more efficient. |
# can use a database trick to make the upload more efficient. |
|
|
if file and not from_tmp: |
if file and not from_tmp: |
self._getOb(id).manage_upload(file) |
fob.manage_upload(file) |
elif file and from_tmp: |
elif file and from_tmp: |
self._getOb(id).manage_upload_from_tmp(file) |
fob.manage_upload_from_tmp(file) |
if content_type: |
if content_type: |
self._getOb(id).content_type=content_type |
fob.content_type=content_type |
|
|
|
logging.debug("reindex1: %s"%repr(self)) |
self.reindex_object() |
self.reindex_object() |
self._getOb(id).reindex_object() |
logging.debug("reindex2: %s in %s"%(repr(fob), repr(fob.default_catalog))) |
|
fob.reindex_object() |
|
|
if REQUEST is not None: |
if REQUEST is not None: |
REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') |
REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') |
|
|
|
|
class CDLIFile(extVersionedFile,CatalogAware): |
class CDLIFile(extVersionedFile,CatalogAware): |
"""CDLI file""" |
"""CDLI file""" |
|
|