I'm trying to insert the REQUEST object into a new DTML document to record errors on a page. It doesn't seem to like the way I'm doing it and I can't figure out how to get it to work. I tried: <dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))"> <dtml-call "manage_addDTMLDocument(newname, 'Error', 'REQUEST')"> and I get a Key Error: Error Type: KeyError Error Value: read I've tried creating the document first, and then using manage_edit to insert it, and the same thing happens. I really need to dump the REQUEST object somewhere when there's been an error so I can see what happened. TIA Rick
oops. The one I'm using doesn't have quotes around REQUEST: <dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))"> <dtml-call "manage_addDTMLDocument(newname, 'Error', REQUEST)"> Rick D. Rick Anderson wrote:
I'm trying to insert the REQUEST object into a new DTML document to record errors on a page. It doesn't seem to like the way I'm doing it and I can't figure out how to get it to work.
I tried:
<dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))"> <dtml-call "manage_addDTMLDocument(newname, 'Error', 'REQUEST')">
and I get a Key Error:
Error Type: KeyError Error Value: read
I've tried creating the document first, and then using manage_edit to insert it, and the same thing happens. I really need to dump the REQUEST object somewhere when there's been an error so I can see what happened.
TIA
Rick
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
"D. Rick Anderson" wrote:
I'm trying to insert the REQUEST object into a new DTML document to record errors on a page. It doesn't seem to like the way I'm doing it and I can't figure out how to get it to work.
I tried:
<dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))"> <dtml-call "manage_addDTMLDocument(newname, 'Error', 'REQUEST')">
<dtml-call "manage_addDTMLDocument(newname, 'Error', REQUEST)"> ? hth
and I get a Key Error:
Error Type: KeyError Error Value: read
I've tried creating the document first, and then using manage_edit to insert it, and the same thing happens. I really need to dump the REQUEST object somewhere when there's been an error so I can see what happened.
------------------------------------------------------------- Who's got only a hammer sees the world as a nail hans augustin (software developer) hans@beehive.de beehive elektronische medien GmbH http://www.beehive.de phone: +49 30 847-82 0 fax: +49 30 847-82 299
I can use a simple script to retieve the file contents and the relevant meta data from the database but the browsers default to saving the name of the script in the 'href='. Will I need to generate a dtml method with the proper name that does a call to the script and then destroy this method when I'm done? Surely there's something more elegant than doing it that way. If i get this one I should stay busy for a while and stop harassing the list ;^) Thanks, Charlie
How about this: response = REQUEST.RESPONSE response.setHeader('Content-Disposition', 'inline; filename='TheFilenameYouWant.txt') HTH - Ziniti Charles Fulton wrote:
I can use a simple script to retieve the file contents and the relevant meta data from the database but the browsers default to saving the name of the script in the 'href='.
Will I need to generate a dtml method with the proper name that does a call to the script and then destroy this method when I'm done? Surely there's something more elegant than doing it that way.
If i get this one I should stay busy for a while and stop harassing the list ;^)
Thanks, Charlie
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Charles Fulton -
D. Rick Anderson -
hans -
John Ziniti