diff options
Diffstat (limited to 'ishtar_common/management/commands/update_search_vectors.py')
-rw-r--r-- | ishtar_common/management/commands/update_search_vectors.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/management/commands/update_search_vectors.py b/ishtar_common/management/commands/update_search_vectors.py index c158a2588..9fa93277c 100644 --- a/ishtar_common/management/commands/update_search_vectors.py +++ b/ishtar_common/management/commands/update_search_vectors.py @@ -11,8 +11,15 @@ class Command(BaseCommand): help = "./manage.py update_search_vectors\n\n"\ "Update full texte search vectors." + def add_arguments(self, parser): + parser.add_argument( + '--model', type=str, default='', dest='model', + help='Specific model to update') + def handle(self, *args, **options): for model in django.apps.apps.get_models(): + if options['model'] and model.__name__ != options['model']: + continue if hasattr(model, "update_search_vector") and \ (getattr(model, "BASE_SEARCH_VECTORS", None) or getattr(model, "INT_SEARCH_VECTORS", None) or |