Consider the former

http://domain/post/a_post_title

assuming your app is called "app" and in controller "defaul.py" you
have an action

def post():
    post_title=request.args(0)
    return post_title

then in routes.py

routes_in=('/post/(?P<title>.*)','/app/default/post/\g<title>'),)
routes_out=('/app/default/post/(?P<title>.*)','/post/\g<title>'),)

Mind that '-' is not allowed in URL, only _ are allowed. There is a
way around that also.

On Oct 6, 3:43 pm, Mengu <[email protected]> wrote:
> anyone?
>
> On Oct 6, 10:23 am, mengu <[email protected]> wrote:
>
> > hi everyone,
>
> > i am coding a blog system with web2py that will be licensed under gpl.
> > hopefully, it will be a nice one with tagging, categorising, syntax
> > highlighting, built-in accordion menu and many other things.
>
> > my first question is about routes. can you please let me know how to
> > set the routes.py in order to get the urls like the 
> > following:http://domain/post/a-post-titlehttp://domain/category/categorynameorh...
>
> > my second question is about a database query. i have the following
> > query in order to retrieve all the posts and those posts' categories.
> > the code can be found athttp://mengu.pastebin.com/m111e1a47howcan i
> > make the query more simple?
>
> > also, wouldn''t it be nice to get an object with field names for
> > results that we get by db.executesql()?
>
> > thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to