Andriy Kornatskyy avatar Andriy Kornatskyy committed f2bc9dc

Updated documentation by explaining cases when KeyError is raised.

Comments (0)

Files changed (1)

doc/userguide.rst

 to replace named groups of the path matching pattern::
 
     >>> r = RegexRoute(
-    ...     r'abc/(?P<month>\d+)/(?P<day>\d+)'
+    ...     r'abc/(?P<month>\d+)/(?P<day>\d+)',
+    ...     kwargs=dict(month=1, day=1)
     ... )
     >>> r.path_for(dict(month=6, day=9))
     'abc/6/9'
     >>> r.path_for(dict(month=6))
-    'abc/6'
+    'abc/6/1'
     >>> r.path_for()
-    'abc'
+    'abc/1/1'
 
 Values passed to :py:meth:`~wheezy.routing.router.PathRouter.path_for`
 method override any values used during initialization of url mapping.
+
+:py:class:`KeyError` is raised in case you try to build a path
+that doesn't exist or insufficient arguments for building a path.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.