Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django iterate over all objects

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)
Source by blog.etianen.com #
 
PREVIOUS NEXT
Tagged: #django #iterate #objects
ADD COMMENT
Topic
Name
8+8 =