<s> from __future__ import absolute_import , unicode_literals <EOL> from django import forms <EOL> from django . db import models <EOL> class RichTextFormField ( forms . fields . CharField ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( RichTextFormField , self ) . __init__ ( * args , ** kwargs ) <EOL> css_class = self . widget . attrs . get ( '<STR_LIT:class>' , '<STR_LIT>' ) <EOL> css_class += '<STR_LIT>' <EOL> self . widget . attrs [ '<STR_LIT:class>' ] = css_class <EOL> def clean ( self , value ) : <EOL> return super ( RichTextFormField , self ) . clean ( value ) <EOL> class RichTextField ( models . TextField ) : <EOL> """<STR_LIT>""" <EOL> def formfield ( self , form_class = RichTextFormField , ** kwargs ) : <EOL> return super ( RichTextField , self ) . formfield ( <EOL> form_class = form_class , ** kwargs ) <EOL> try : <EOL> from south . modelsinspector import add_introspection_rules <EOL> RichTextField_introspection_rule = ( ( RichTextField , ) , [ ] , { } , ) <EOL> add_introspection_rules ( <EOL> rules = [ RichTextField_introspection_rule ] , <EOL> patterns = [ "<STR_LIT>" ] ) <EOL> except ImportError : <EOL> pass </s>
