Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Django, limit queryset without slicing

people = People.objects.order_by(name).filter(age__gt=65) # unevaluated
people.query.set_limits(start, stop)  # still unevaluated
for person in people:  # now its evaluated
    person.do_the_thing()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #limit #queryset #slicing
ADD COMMENT
Topic
Name
9+7 =