On Sep 23, 5:24 pm, IanSR wrote:
> Is there some trick to parse
>
> http://www.example.com/foo/42
>
> such that "42" becomes an integer parameter to the view function,
> instead of a string?
>
> Right now I have to do:
>
> from my.app.views import foo
>
> urlpatterns = patterns('',
> (r'foo/(
Is there some trick to parse
http://www.example.com/foo/42
such that "42" becomes an integer parameter to the view function,
instead of a string?
Right now I have to do:
from my.app.views import foo
urlpatterns = patterns('',
(r'foo/(?P\d+)/?$', foo),
)
my/app/views.py
def foo(reque
2 matches
Mail list logo