Django Book 翻译
菜单>:
TOC
返回
原文:
Many times, as in this example, youll find yourself calculating some values, storing them in variables (e.g., ``now`` in the preceding code), and sending those variables to the template. Particularly lazy programmers should note that its slightly redundant to have to give names for temporary variables *and* give names for the template variables. Not only is it redundant, but also its extra typing.
翻译:
很多时候,就像在这个范例中那样,你发现自己一直在计算某个变量,保存结果到变量中(比如:前面代码中的 ``now`` ),然后将这些变量发送给模板。特别懒的程序员可能注意到给这些临时变量 *和* 模板变量命名显得有点多余。不但多余,而且还要进行额外的键盘输入。
备注:
译者: