i spent the past 3 hours going through my own validate code, and the
original pylons that i forked off of, trying to figure out why params
is always empty on a form error.

i finally tracked down the issue.

@validate has this line, so that the form can be re-run as a GET with
htmlfill args:
    request.environ['REQUEST_METHOD']= 'GET'

and this is the weird behavior:

once this is set, it appears to be impossible to access any POST vars
via :
   request.params.get(var) # makes sense
   request.params.POST(var) # empty
   request.params.POST # empty

however if i run this:
    request.environ['REQUEST_METHOD']= 'POST'

then all my data is accessible again.

this seems to happen because of this line in webob:

        if self.method not in ('POST', 'PUT'):
            return NoVars('Not a form request')

i'm not sure if this was intentional , or some sort of optimization.

-- 
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