My Web-programming and Python noobs continues to show. Thanks for
bearing with me.
I have a view with a fragment along the lines of the following to
generates a list of links. foos has been generated in the controller.
{{for foo in foos:}}
<li><a href="{{=URL('show', args=
foo.name)}}">{{=
foo.name}}</a></li>
{{pass}}
This works fine until
foo.name has spaces and/or other URL-unfriendly
chars in it. So the questions are:
* Does web2py have its own mechanism for encoding/decoding URLs that
is useful here?
* If not, what is the preferred Python lib for doing URL encoding/
decoding?
(P.S. I am aware that there are other ways of addressing this issue:
e.g., use vars (which web2py seems to automatically encode) instead of
args, or use args=
foo.id instead or args=
foo.name. In any event, it'd
be good to know the web2py way to encode/decode URLs.)