If you're receiving the title from a form submission, you can use the 
IS_SLUG validator on the title field, which will convert it to a slug 
(remove non-alphanumeric characters and convert spaces to hyphens). You can 
also use the validator on it's own:

>>> title_slug = IS_SLUG()('Today is Wonderful!')[0]
>>> print title_slug
today-is-wonderful

See http://web2py.com/book/default/chapter/07#Validators.

Anthony

On Wednesday, November 30, 2011 10:09:33 AM UTC-5, lyn2py wrote:
>
> If I want to create a link from a string, is there a function in
> web2py to do that?
>
> For example I have a post title "Today is Wonderful!" and I want to
> create
> >> /blog/show/today-is-wonderful
> instead of
> >> /blog/show/today-is-wonderful%21
> which gives a Invalid Request error...
>
> Thanks!
>
>
>

Reply via email to