<s> import six <EOL> from django . db . models . fields import CharField , TextField <EOL> from django . utils . translation import ugettext_lazy <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django_markup . markup import formatter <EOL> class MarkupField ( CharField ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , default = False , formatter = formatter , * args , ** kwargs ) : <EOL> if default : <EOL> if default not in formatter . filter_list : <EOL> raise ImproperlyConfigured ( "<STR_LIT>" % <EOL> ( default , '<STR_LIT:U+002CU+0020>' . join ( six . iterkeys ( formatter . filter_list ) ) ) ) <EOL> kwargs . setdefault ( '<STR_LIT:default>' , default ) <EOL> kwargs . setdefault ( '<STR_LIT:max_length>' , <NUM_LIT:255> ) <EOL> kwargs . setdefault ( '<STR_LIT>' , formatter . choices ( ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , ugettext_lazy ( '<STR_LIT>' ) ) <EOL> CharField . __init__ ( self , * args , ** kwargs ) <EOL> try : <EOL> from south . modelsinspector import add_introspection_rules <EOL> add_introspection_rules ( [ ] , [ '<STR_LIT>' ] ) <EOL> except ImportError : <EOL> pass </s>
