Skip to content

Latest commit

 

History

History
executable file
·
28 lines (17 loc) · 569 Bytes

README.md

File metadata and controls

executable file
·
28 lines (17 loc) · 569 Bytes

Django Query Chunk

pypi

Django Query Chunk is used to split big queries into multiple chunks for prevent (too high) memory usage. The chunk function will split the query set into several isolated queries.

Requirements

  • Python: >=3.6
  • Django: >=2.0

Installation

pip install django-query-chunk

Usage

from query_chunk import chunk

chunk_size = 300

for book in chunk(Book.objects.all(), chunk_size):
    # process book