📜  django 遍历所有对象 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:54.957000             🧑  作者: Mango

代码示例1
star_set = Star.objects.all()
# The `iterator()` method ensures only a few rows are fetched from
# the database at a time, saving memory.
for star in star_set.iterator():
    print(star.name)