From 270f7e21676f043464e9a3e252fec0a63e3c0b2a Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 30 Dec 2013 17:55:12 -0500 Subject: [PATCH] Fixed #21708 -- Added some headings to separate unrelated topics. Thanks ashley at ashleymills.com for the suggestion. --- docs/topics/http/urls.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index a170a4e18d..36a43ed704 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -178,8 +178,8 @@ The URLconf doesn't look at the request method. In other words, all request methods -- ``POST``, ``GET``, ``HEAD``, etc. -- will be routed to the same function for the same URL. -Notes on capturing text in URLs -=============================== +Captured arguments are always strings +===================================== Each captured argument is sent to the view as a plain Python string, regardless of what sort of match the regular expression makes. For example, in this @@ -190,6 +190,9 @@ URLconf line:: ...the ``year`` argument to ``news.views.year_archive()`` will be a string, not an integer, even though the ``\d{4}`` will only match integer strings. +Specifying defaults for view arguments +====================================== + A convenient trick is to specify default parameters for your views' arguments. Here's an example URLconf and view::