|
Home > Archive > Apache Mod-Python > May 2005 > Commented: (MODPYTHON-38) Passing req.form into psp.PSP().
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Commented: (MODPYTHON-38) Passing req.form into psp.PSP().
|
|
| Graham Dumpleton (JIRA) 2005-05-17, 7:46 am |
| [ http://issues.apache.org/jira/brows...=3Dcomments#ac=
tion_65564 ]
=20
Graham Dumpleton commented on MODPYTHON-38:
-------------------------------------------
Have something else to question in the run() code above. That is, I think
that doing:
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if session is not None:=20
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
A0=A0=A0=A0=A0=A0=A0session.unlock(=
)
is questionable and probably shouldn't be done.
It should be done in the cleanup handler registered by the session object
itself when it is created if I remember things correctly.
Especially if we start caching session object in the req object, by unlocki=
ng
it, even if it was created by the PSP object, it makes the session object
unusable in code that may follow explicit use of PSP object in a handler,
or in a subsequent log handler.
> Passing req.form into psp.PSP().
> --------------------------------
>
> Key: MODPYTHON-38
> URL: http://issues.apache.org/jira/browse/MODPYTHON-38
> Project: mod_python
> Type: Improvement
> Versions: 3.1.4
> Reporter: Graham Dumpleton
> Priority: Minor
>
> When calling psp.PSP() explicitly to render PSP pages, it will internally=
setup
> req.form if it determines that the form is accessed by the PSP page.
> Problem is that if you are wanting to trigger psp.PSP() from a publisher =
function
> any form parameters have already been processed and req.form created. For=
a
> POST request this is problematic as in doing this it will have consumed a=
ll the
> content of the request.
> This means that when the form is processed a second time by psp.PSP(), it=
will
> find no request content. Thus, the PSP page will only be able to make use=
of
> GET form parameters and not POST form parameters.
> It would be an improvement if psp.PSP() allowed a instance of util.FieldS=
torage
> which has previously been created to be passed in through the "form" para=
meter
> of the constructor. Ie.,
> template =3D psp. PSP(req,filename=3Dpath,vars=3Dsettings,
form=3Dreq.f=
orm)
> template.run()
--=20
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
| |
| Jim Gallacher 2005-05-17, 5:46 pm |
| Having a conversation using comments within jira seems really weird.
Anyone else? Just me?
Especially when all I want to say is I agree. 
Graham Dumpleton (JIRA) wrote:
> [ http://issues.apache.org/jira/brows...ts#action_65564 ]
>
> Graham Dumpleton commented on MODPYTHON-38:
> -------------------------------------------
>
> Have something else to question in the run() code above. That is, I think
> that doing:
>
> if session is not None:
> session.unlock()
>
> is questionable and probably shouldn't be done.
>
> It should be done in the cleanup handler registered by the session object
> itself when it is created if I remember things correctly.
>
> Especially if we start caching session object in the req object, by unlocking
> it, even if it was created by the PSP object, it makes the session object
> unusable in code that may follow explicit use of PSP object in a handler,
> or in a subsequent log handler.
>
>
>
>
>
>
>
>
|
|
|
|
|