Django Book 翻译
菜单>:
TOC
返回
原文:
Each loader function should also have an ``is_usable`` function attribute. This is a Boolean that informs the template engine whether this loader is available in the current Python installation. For example, the eggs loader (which is capable of loading templates from Python eggs) sets ``is_usable`` to ``False`` if the ``pkg_resources`` module isnt installed, because ``pkg_resources`` is necessary to read data from eggs.
翻译:
每个加载函数都应该有一个名为 ``is_usable`` 的函数属性。这个属性是一个布尔值,用于告知模板引擎这个加载器是否在当前安装的Python中可用。例如,如果 ``pkg_resources`` 模块没有安装的话,eggs加载器(它能够从python eggs中加载模板)就应该把 ``is_usable`` 设为 ``False`` ,因为必须通过 ``pkg_resources`` 才能从eggs中读取数据。
备注:
译者: