diff options
Diffstat (limited to 'ishtar_common/management/commands')
| -rw-r--r-- | ishtar_common/management/commands/update_search_vectors.py | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/ishtar_common/management/commands/update_search_vectors.py b/ishtar_common/management/commands/update_search_vectors.py index c73a6e88e..d301a3afc 100644 --- a/ishtar_common/management/commands/update_search_vectors.py +++ b/ishtar_common/management/commands/update_search_vectors.py @@ -14,11 +14,14 @@ class Command(BaseCommand):      def handle(self, *args, **options):          for model in django.apps.apps.get_models():              if hasattr(model, "update_search_vector") and \ -                    getattr(model, "BASE_SEARCH_VECTORS", None): +                    (getattr(model, "BASE_SEARCH_VECTORS", None) or +                     getattr(model, "INT_SEARCH_VECTORS", None) or +                     getattr(model, "M2M_SEARCH_VECTORS", None) or +                     getattr(model, "PARENT_SEARCH_VECTORS", None)):                  self.stdout.write("\n* update {}".format(model))                  total = model.objects.count()                  for idx, item in enumerate(model.objects.all()): -                    sys.stdout.write("\r{}/{} ".format(idx, total)) +                    sys.stdout.write("\r{}/{} ".format(idx + 1, total))                      sys.stdout.flush()                      item.update_search_vector()          self.stdout.write("\n") | 
