I think I found the origin of this problem (it is a different
behaviour in the cgi module or possibly the browser).
In the appadmin.py of your app can you replace line 202
TR('', '', INPUT(_type='submit', _value='submit'))))
with
TR('', '', INPUT(_type='submit',
_value='submit'))),_action=URL(r=request,args=request.args))
and see if the problem goes away?
Massimo
On Mar 2, 2:02 pm, Guido Kollerie <[email protected]> wrote:
> FYI,
>
> According to:
>
> http://docs.python.org/whatsnew/2.6.html#new-improved-and-deprecated-...
>
> "The cgi module will now read variables from the query string of an
> HTTP POST request. This makes it possible to use form actions with
> URLs that include query strings such as
> “/cgi-bin/add.py?category=1”. (Contributed by Alexandre Fiori and
> Nubis; issue 1817.)"
>
> Issue 1817:http://bugs.python.org/issue1817
>
> This wrecks havoc with the appadmin.py when submitting the default
> search query in 'database db select'. As it happens the form POSTs the
> form values, and the URL happens to have a query string as well:
>
> http://127.0.0.1:8000/images/appadmin/select/db?query=db.image.id%3E0
>
> This results in 'request.vars.query' to become a list:
>
> request.vars.query ----> <type 'list'>, value ---->
> ['db.image.id>0', 'db.image.id>0']
>
> and Web2py to raise to following exception:
>
> Traceback (most recent call last):
> File "/Users/gkoller/devel/web2py/gluon/restricted.py", line
> 98, in restricted
> exec ccode in environment
> File "/Users/gkoller/devel/web2py/applications/images/
> controllers/appadmin.py", line 270, in <module>
> File "/Users/gkoller/devel/web2py/gluon/globals.py", line 75,
> in <lambda>
> self._caller = lambda f: f()
> File "/Users/gkoller/devel/web2py/applications/images/
> controllers/appadmin.py", line 157, in select
> match = regex.match(request.vars.query)
> TypeError: expected string or buffer
>
> Not sure if the CGI module should have been changed in this way in
> Python 2.6, or that Web2py should be modified to accomodate CGI's new
> behaviour in Python 2.6.
>
> Cheers, Guido
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---