Django Book 翻译
菜单>:
TOC
返回
原文:
Note that ``int()`` itself raises a ``ValueError`` when you pass it a string that is not composed solely of digits, but were avoiding that error in this case because the regular expression in our URLconf has ensured that only strings containing digits are passed to the view function.
翻译:
注意,当你传递了一个并不完全包含数字的字符串时, ``int()`` 会抛出 ``ValueError`` 的异常,不过我们已经避免了这个错误,因为在URLconf的正则表达式中已经确保只有包含数字的字符串才会传到这个视图函数中。
备注:
译者: