Django Book 翻译
菜单>:
TOC
返回
原文:
For example, lets write a template tag, ``{% current_time %}`` , that displays the current date/time, formatted according to a parameter given in the tag, in ``strftime`` syntax (see ``http://www.djangoproject.com/r/python/strftime/`` ). Its a good idea to decide the tag syntax before anything else. In our case, lets say the tag should be used like this:
翻译:
例如,写一个显示当前日期的模板标签:{% current_time %},该标签会根据参数指定的 ``strftime`` 格式(参见: ``http://www.djangoproject.com/r/python/strftime/`` )显示当前时间。在继续做其它事情以前,先决定标签的语法是一个好主意。在我们的例子里,该标签将会像这样被使用:
备注:
译者: