<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . db import models <EOL> class Command ( BaseCommand ) : <EOL> help = '<STR_LIT>' <EOL> args = "<STR_LIT>" <EOL> def handle ( self , app = None , model = None , ** options ) : <EOL> if not app : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> try : <EOL> app_module = models . get_app ( app ) <EOL> except ImproperlyConfigured : <EOL> raise CommandError ( "<STR_LIT>" % app ) <EOL> app_models = [ ] <EOL> if model : <EOL> m = models . get_model ( app , model ) <EOL> if not m : <EOL> raise CommandError ( "<STR_LIT>" % model ) <EOL> app_models . append ( models . get_model ( app , model ) ) <EOL> else : <EOL> app_models += models . get_models ( app_module ) <EOL> app_models_for_process = [ x for x in app_models if getattr ( x , '<STR_LIT>' , None ) ] <EOL> if not app_models_for_process : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> for m in app_models_for_process : <EOL> print ( "<STR_LIT>" % m , end = '<STR_LIT>' ) <EOL> m . _fts_manager . update_search_field ( ) <EOL> print ( "<STR_LIT>" ) </s>
