I had a problem with versions. I realized this Python Script. request = container.REQUEST response = request.RESPONSE idVersion = 'modifyNews' container.manage_addProduct['OFSP'].manage_addVersion(idVersion, title="") version = getattr(container, idVersion) version.enter(request, response) idDoc = 'doc' version.manage_addProduct['OFSP'].manage_addDTMLDocument(idDoc,title="") doc = getattr(container, idDoc) content = "Today date: " + str(DateTime()) doc.manage_upload(content) version.leave(request, response) After this, when I go back to manage_main I would expect 'doc' document has a red locked ball. But it is not. I think it is a transaction problem, but how can I resolve it? Thannks, Pino _________________________________________________________________ Comunica in un Â’altra dimensione con MSN Extra Storage! http://www.msn.it/msnservizi/es/extra_storage_tag/
Pino Silvestre wrote at 2003-2-19 11:13 +0000:
I had a problem with versions. I realized this Python Script.
request = container.REQUEST response = request.RESPONSE
idVersion = 'modifyNews' container.manage_addProduct['OFSP'].manage_addVersion(idVersion, title="") version = getattr(container, idVersion) version.enter(request, response) idDoc = 'doc' version.manage_addProduct['OFSP'].manage_addDTMLDocument(idDoc,title="") doc = getattr(container, idDoc) content = "Today date: " + str(DateTime()) doc.manage_upload(content) version.leave(request, response)
After this, when I go back to manage_main I would expect 'doc' document has a red locked ball. But it is not. I think it is a transaction problem, but how can I resolve it?
You are probably right. The look takes effect only when the transaction is committed. You may either commit it (in an External Method!) with "get_transaction().commit()" (you know what you are doing?) or redirect to the target place (in which case, the transaction is committed automatically). Dieter
participants (2)
-
Dieter Maurer -
Pino Silvestre