1 from django.core.management.base import BaseCommand
3 from optparse import make_option
4 class Command(BaseCommand):
5 help = 'Reindex everything.'
8 option_list = BaseCommand.option_list + (
9 make_option('-n', '--book-id', action='store_true', dest='book_id', default=False,
12 def handle(self, *args, **opts):
13 from catalogue.models import Book
15 idx = search.ReusableIndex()
22 books += Book.objects.filter(id=int(a)).all()
24 books += Book.objects.filter(slug=a).all()
26 books = Book.objects.all()
31 print 'Reindexing tags.'