def handle(self, *args, **options): translation.activate(settings.LANGUAGE_CODE) if options['all']: delete_index_es() create_index_es() for video in VIDEOS: index_es(video) elif options['video_id']: for video_id in options['video_id']: self.manage_es(video_id) else: self.stdout.write( self.style.ERROR( "****** Warning: you must give some arguments: %s ******" % self.args)) translation.deactivate()
def handle(self, *args, **options): translation.activate(settings.LANGUAGE_CODE) if options["all"]: delete_index_es() time.sleep(10) create_index_es() time.sleep(10) iteration = 0 for video in VIDEOS: if iteration % 1000 == 0: time.sleep(10) iteration += 1 index_es(video) elif options["video_id"]: for video_id in options["video_id"]: self.manage_es(video_id) else: self.stdout.write( self.style.ERROR( "****** Warning: you must give some arguments: %s ******" % self.args)) translation.deactivate()
def handle(self, *args, **options): delete_index_es() create_index_es() self.stdout.write( self.style.SUCCESS('Successfully create index Video'))