Django Book 翻译
菜单>:
TOC
返回
原文:
In a newly created ``QuerySet`` , the cache is empty. The first time a ``QuerySet`` is evaluated and, hence, a database query happens Django saves the query results in the ``QuerySet`` s cache and returns the results that have been explicitly requested (e.g., the next element, if the ``QuerySet`` is being iterated over). Subsequent evaluations of the ``QuerySet`` reuse the cached results.
翻译:
在刚被创建的 ``QuerySet`` 中,缓存是空的。当 ``QuerySet`` 第一次被赋值,就是执行数据库查询的时候,Django会把查询结果保存到这个 ``QuerySet`` 的缓存中,并返回请求结果(例如, ``QuerySet`` 迭代结束的时候,就会返回下一条记录)。再次使用 ``QuerySet`` 的值的话会重复使用缓存中的内容。
备注:
译者: