summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bangert <ben@groovie.org>2015-05-17 20:17:20 -0700
committerBen Bangert <ben@groovie.org>2015-05-17 20:17:20 -0700
commit3a0b55ca72f34d1c252616f1c4d2927d6a2e913c (patch)
tree5eba612c2f1deede0a6e894e099c2026ca1be942
parent153e8e4fc3c8df438113e3df4999d76fe01dc831 (diff)
parent38808bd3755c61b72400e92da15c906c8bc41fd5 (diff)
downloadroutes-3a0b55ca72f34d1c252616f1c4d2927d6a2e913c.tar.gz
Merge pull request #45 from huanghao/patch-3
Fix wrong url pattern
-rw-r--r--docs/porting.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/porting.rst b/docs/porting.rst
index f54c7b3..82e538c 100644
--- a/docs/porting.rst
+++ b/docs/porting.rst
@@ -37,7 +37,7 @@ When the URL is looked up, it should be matched against the Mapper. When
matching an incoming URL, it is assumed that the URL path is the only string
being matched. All query args should be stripped before matching::
- m.connect('articles/{year}/{month}', controller='blog', action='view', year=None)
+ m.connect('/articles/{year}/{month}', controller='blog', action='view', year=None)
m.match('/articles/2003/10')
# {'controller':'blog', 'action':'view', 'year':'2003', 'month':'10'}
@@ -46,7 +46,7 @@ Matching a URL will return a dict of the match results, if you'd like to
differentiate between where the argument came from you can use routematch which
will return the Route object that has all these details::
- m.connect('articles/{year}/{month}', controller='blog', action='view', year=None)
+ m.connect('/articles/{year}/{month}', controller='blog', action='view', year=None)
result = m.routematch('/articles/2003/10')
# result is a tuple of the match dict and the Route object