#NEWLINE# def pre_save( self , model_instance , add ) : #NEWLINE# #INDENT# value = super ( MarkupField , self ) . pre_save ( model_instance , add ) #NEWLINE# if ( value . markup_type not in self . markup_choices_list ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid markup type (%s), allowed values: %s' % ( value . markup_type , ', ' . join ( add . markup_choices_list ) ) ) ) #NEWLINE# #UNINDENT# if ( value . raw is not None ) : #NEWLINE# #INDENT# if self . escape_html : #NEWLINE# #INDENT# raw = escape ( value . raw ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raw = value . raw #NEWLINE# #UNINDENT# rendered = self . markup_choices_dict [ value . markup_type ] ( raw ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rendered = None #NEWLINE# #UNINDENT# setattr ( model_instance , _rendered_field_name ( self . attname ) , rendered ) #NEWLINE# return value . raw