On Fri, Jun 4, 2010 at 2:13 AM, Petr Blahos <[email protected]> wrote:
>>> First of all, I would like to know, whether my idea that request.params
>>> should be there is correct.
>>
>> You called it with "?par1=xxx", so c.par1 should be "xxx" and that
>> should be the default value in the text box.;
>>
>> In 'save' decorated with @validate, you'd get the processed variables
>> from self.form_result. request.params contains the variables as they
>> were before validating.
>
> Yes, in save. Not in index though.
>   @validate(schema=V1(),form="index")
>                                                ^^^^^^^
> this index
>
>>> I added some debug prints and found out that the request.params,
>>> as well as request.POST get cleared after setting
>>> request.environ['REQUEST_METHOD']
>>>        if errors:
>>>            ....
>>>            request.environ['REQUEST_METHOD'] = 'GET'

I don't know why it does that. Maybe to help the error middleware? In
any case, if changing the REQUEST_METHOD has other side effects, we
should make sure whether they're helping or hindering.

Looking at the webob source, .params, .str_params, .GET and .POST are
all properties.  .POST hides its parameters if the request method is
not POST or PUT.  .GET does something complex, but it doesn't look
directly related to the request method as far as I can tell.

>>>
>>> They stay in request.environ['webob._parsed_post_vars'][0] though.
>>
>> Why would you want to set the request method? it should stay as it
>
> I forgot to mention: This happens in pylons/decorators/__init__.py's
> validate. So it's not me who sets the request method :-)
> True enough, if I comment that line out, my code starts working again.
>
>> Maybe WebOb clears them out because of how it intended REQUEST_METHOD
>> to be set. If you think it's a bug you can bring it up on the Paste
>> list.
>
> I am not sure if it is a bug. Still no harm in asking on the Paste list.
> Thanks!

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to