Django Book 翻译
菜单>:
TOC
返回
原文:
Now that weve designated a wildcard for the URL, we need a way of passing that data to the view function, so that we can use a single view function for any arbitrary hour offset. We do this by placing parentheses around the data in the URLpattern that we want to save. In the case of our example, we want to save whatever number was entered in the URL, so lets put parentheses around the ``\d{1,2}`` :
翻译:
现在我们已经设计了一个带通配符的URL,我们需要一个方法把它传递到视图函数里去,这样 我们只用一个视图函数就可以处理所有的时间段了。我们使用圆括号把参数在URL模式里标识 出来。在这个例子中,我们想要把这些数字作为参数,用圆括号把 ``\d{1,2}`` 包围起来:
备注:
译者: