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