Exemplo n.º 1
0
 def translation_fields(self):
     try:
         from modeltranslation.management.commands \
                 import (update_translation_fields as update_fields,
                         sync_translation_fields as create_fields)
     except ImportError:
         return
     update = self.confirm("\nDjango-modeltranslation is installed for "
                           "this project and you have specified to use "
                           "i18n.\nWould you like to update translation "
                           "fields from the default ones? (yes/no): ")
     if update:
         create_fields.Command().execute(verbosity=self.verbosity,
                                         interactive=False)
         update_fields.Command().execute(verbosity=self.verbosity)
 def translation_fields(self):
     try:
         from modeltranslation.management.commands import (
             update_translation_fields as update_fields,
             sync_translation_fields as create_fields,
         )
     except ImportError:
         return
     update = self.confirm("\nDjango-modeltranslation is installed for "
                           "this project and you have specified to use "
                           "i18n.\nWould you like to update translation "
                           "fields from the default ones? (yes/no): ")
     if update:
         options = {
             "verbosity": self.verbosity,
             "interactive": self.interactive,
         }
         call_command(create_fields.Command(), **options)
         call_command(update_fields.Command(), **options)