decreased memory footprint
authorBryan <btbonval@gmail.com>
Tue, 14 Jan 2014 08:45:36 +0000 (03:45 -0500)
committerBryan <btbonval@gmail.com>
Thu, 16 Jan 2014 01:30:33 +0000 (20:30 -0500)
karmaworld/apps/notes/management/commands/populate_indexden.py

index d80106ca56373a3ef4bf42737ce681c9df7624da..2ce38358043f371dd9a042a145076dcc79e11622 100644 (file)
@@ -14,9 +14,7 @@ class Command(BaseCommand):
            "in the index that are not overwritten will still be around."
 
     def handle(self, *args, **kwargs):
-        notes = Note.objects.all()
-
-        for note in notes:
+        for note in Note.object.iterator():
             try:
                 print "Indexing {n}".format(n=note)
                 add_document(note)