def handle(self,*args,**options): queryset=Question.objects.all() all_loaded=elasticsearch.bulk_load(queryset) if all_loaded: self.stdout.write(self.style.SUCCESS('Successfully loaded all questions into Elasticsearch')) else: self.stdout.write(self.style.WARNING('some questions not loaded successfully. see logged errors'))
def handle(self, *args, **options): querset = Question.objects.all() all_loaded = elasticsearch.bulk_load(querset) if all_loaded: self.stdout.write( self.style.SUCCESS( 'Done loading all questions into elasticsearch')) else: self.stdout.write( self.style.WARNING( 'Some questions not loaded Successfully. \n See logged error' ))