Skip to content

Commit b441588

Browse files
committed
Remove the paginated function definition
Signed-off-by: MohannadAK <[email protected]>
1 parent 1e5b47b commit b441588

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

packagedb/models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,6 @@ def get_or_none(self, *args, **kwargs):
7171
except Package.DoesNotExist:
7272
return
7373

74-
def paginated(self, per_page=5000):
75-
"""
76-
Iterate over a (large) QuerySet by chunks of ``per_page`` items.
77-
This technique is essential for preventing memory issues when iterating
78-
See these links for inspiration:
79-
https://nextlinklabs.com/resources/insights/django-big-data-iteration
80-
https://stackoverflow.com/questions/4222176/why-is-iterating-through-a-large-django-queryset-consuming-massive-amounts-of-me/
81-
"""
82-
paginator = Paginator(self, per_page=per_page)
83-
for page_number in paginator.page_range:
84-
page = paginator.page(page_number)
85-
yield from page.object_list
86-
8774

8875
VCS_CHOICES = [
8976
("git", "git"),

0 commit comments

Comments
 (0)