예제 #1
0
파일: search.py 프로젝트: MechanisM/djoosh
 def handle(self, *args, **options):
     try:
         command = args[0]
     except:
         raise CommandError('Please provide a valid command')
     
     if command == 'rebuild':
         for model in site.get_models():
             self.stdout.write('Creating index for %s... ' % model.get_name())
             create_index(model)
             update_index(model)
             self.stdout.write('DONE\n')
예제 #2
0
    def handle(self, *args, **options):
        try:
            command = args[0]
        except:
            raise CommandError('Please provide a valid command')

        if command == 'rebuild':
            for model in site.get_models():
                self.stdout.write('Creating index for %s... ' %
                                  model.get_name())
                create_index(model)
                update_index(model)
                self.stdout.write('DONE\n')
예제 #3
0
파일: signals.py 프로젝트: MechanisM/djoosh
def create_index_handler(search_model, sender=None, **kwargs):
    """ Used on syncdb"""
    utils.create_index(search_model)
예제 #4
0
파일: mixins.py 프로젝트: abaelhe/djoosh-1
 def rebuild(self):
     mod = site.get_search_model(self.model)
     if mod:
         utils.create_index(mod)
         utils.update_index(mod)
예제 #5
0
파일: signals.py 프로젝트: abaelhe/djoosh-1
def create_index_handler(search_model, sender=None, **kwargs):
    """ Used on syncdb"""
    utils.create_index(search_model)