Sorry, accidentally sent the mail. For correctness:

2010/11/19 Alexandre Conrad <alexandre.con...@gmail.com>:
> def month_converter(value):
>    min = 1
>    max = 12
>    value = int(value)
>    if min <= value <= max:
>        return value

r = routehelper(config, converters=dict(int="\d+", month=month_converter)
r.add_handler('articles', '/articles/{action}/{id:int}', handler=....)
r.add_handler('month_archives', '/archives/{month:month}'...)

So "id" wouldn't be converted, only matched. Whereas "month" would be
converted to whatever the callable returns.

-- 
Alex | twitter.com/alexconrad

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to