src/ldt/ldt/management/commands/reindex.py
changeset 1117 3bab1e42acfa
parent 810 e7546394653c
child 1118 e7274a257c9d
--- a/src/ldt/ldt/management/commands/reindex.py	Sun Feb 10 23:04:28 2013 +0100
+++ b/src/ldt/ldt/management/commands/reindex.py	Wed Feb 27 00:07:54 2013 +0100
@@ -29,16 +29,13 @@
             self.stdout.write('Creating contents index...\n')
             contentList = Content.objects.all()
         count = contentList.count()
-        
-        c = lambda i,o: show_progress(i+1, count, o.title, 50)
-            
-        indexer = ContentIndexer(contentList, callback=c)
+                    
+        indexer = ContentIndexer(contentList, callback=(lambda i,o: show_progress(i+1, count, o.title, 50)))
         indexer.index_all()
                     
         if projects:
             self.stdout.write('Creating projects index...\n')
             projectList = Project.objects.filter(contents__in=contentList, state=2).distinct()
             count = projectList.count()
-            c = lambda i,o: show_progress(i+1, count, o.title, 50) 
-            indexer = ProjectIndexer(projectList, callback=c)
+            indexer = ProjectIndexer(projectList, callback=(lambda i,o: show_progress(i+1, count, o.title, 50)))
             indexer.index_all()