Germán M. Bravo committed 3a364da

Improve output style and show working field in color during prompt

  • Participants
  • Parent commits 4a07a6d

Comments (0)

Files changed (1)

File south/creator/

 from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT
 from django.db.models.fields import FieldDoesNotExist, NOT_PROVIDED, CharField, TextField
+from import color_style
 from south.modelsinspector import value_clean
 from south.creator.freezer import remove_useless_attributes, model_key
 from south.utils import datetime_utils
 from south.utils.py3 import raw_input
+style = color_style()
 class Action(object):
         # Oh dear. Ask them what to do.
         print(" ? The field '%s.%s' does not have a default specified, yet is NOT NULL." % (
-            self.model._meta.object_name,
-  ,
+            style.SQL_FIELD('%s.%s' % (self.model._meta.object_name,,
         print(" ? Since you are %s, you MUST specify a default" % self.null_reason)
         print(" ? value to use for existing rows. Would you like to:")
         # Changing field '%(model_name)s.%(field_name)s'
-        db.alter_column(%(table_name)r, %(field_column)r, %(field_def)s)'''
+        db.alter_column(%(table_name)r, %(field_column)r, %(field_def)s)'''[1:] + "\n"
         # Renaming column for '%(model_name)s.%(field_name)s' to match new field type.
-        db.rename_column(%(table_name)r, %(old_column)r, %(new_column)r)'''
+        db.rename_column(%(table_name)r, %(old_column)r, %(new_column)r)'''[1:] + "\n"
     def __init__(self, model, old_field, new_field, old_def, new_def):
         self.model = model