--- a/src/ldt/ldt/management/commands/reindex.py Wed Feb 27 00:07:54 2013 +0100
+++ b/src/ldt/ldt/management/commands/reindex.py Wed Feb 27 00:12:24 2013 +0100
@@ -16,11 +16,17 @@
action="store",
type="string",
help="Index only the content specified by CONTENT_ID."),
+ make_option("-n", "--nocontent",
+ dest="no_content",
+ action="store",
+ type="string",
+ help="Avoid index only the content specified by CONTENT_ID."),
)
def handle(self, *args, **options):
content_id = options.get("content_id")
projects = options.get("projects")
+ no_content = options.get("no_content")
if content_id:
self.stdout.write('Creating index for %s\n' % content_id)
@@ -29,9 +35,10 @@
self.stdout.write('Creating contents index...\n')
contentList = Content.objects.all()
count = contentList.count()
-
- indexer = ContentIndexer(contentList, callback=(lambda i,o: show_progress(i+1, count, o.title, 50)))
- indexer.index_all()
+
+ if not no_content;
+ 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')