Django Book 翻译
菜单>:
TOC
返回
原文:
Be warned, though, that this could have a large memory overhead, because Django will load each element of the list into memory. In contrast, iterating over a ``QuerySet`` will take advantage of your database to load data and instantiate objects only as you need them.
翻译:
但是,需要警告的是这样做会导致很大的内存负载,因为Django会把列表的每一个元素加载到内存。相比之下,对 ``QuerySet`` 进行迭代会利用数据库来加载数据,并且在需要的时候才会把对象实例化。
备注:
译者: