[Zope] How do i clear REQUEST?

Joel Burton joel@joelburton.com
Thu, 14 Mar 2002 09:09:45 -0500 (EST)


On Thu, 14 Mar 2002, honey bee wrote:

> HI,
> I am developing an application which is majorly screen driven.I call a stored proc on submitting a form from
> dtml-doc A to doc B.I check for the presence of a  REQUEST variable and call the proc if it is found  and hence a
> new record is inserted.
> But the prob is  if I happen to refresh the screen the variables are still present and hence one more record is
> created.
>
> I tried calling <dtml-call "REQUEST.form.clear()">
> after the proc, but the variables are still persistent  so end up calling the proc again and again and am not
> able to clear the form.
> kindly help me....... this is getting to be a major prob on my application

If you refresh a screen, the browser submits the same request all over
again. Nothing Zope can do about it.

You could, however, have

form "form.dtml" has action -> python script "action.py" which does the
proc and which immediately redirects -> dtml "result.dtml"

So that if the user refreshes the result page, Zope will reload result,
but won't reload "action.py"

Or, set a SESSION variable that says that you've already done this action
and check that session var before executing the proc.

-- 

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant