<s> from django import forms <EOL> from django . forms . forms import NON_FIELD_ERRORS <EOL> class SelfHandlingMixin ( object ) : <EOL> def __init__ ( self , request , * args , ** kwargs ) : <EOL> self . request = request <EOL> if not hasattr ( self , "<STR_LIT>" ) : <EOL> raise NotImplementedError ( "<STR_LIT>" <EOL> % self . __class__ . __name__ ) <EOL> super ( SelfHandlingMixin , self ) . __init__ ( * args , ** kwargs ) <EOL> class SelfHandlingForm ( SelfHandlingMixin , forms . Form ) : <EOL> """<STR_LIT>""" <EOL> required_css_class = '<STR_LIT>' <EOL> def api_error ( self , message ) : <EOL> """<STR_LIT>""" <EOL> self . _errors [ NON_FIELD_ERRORS ] = self . error_class ( [ message ] ) <EOL> def set_warning ( self , message ) : <EOL> """<STR_LIT>""" <EOL> self . warnings = self . error_class ( [ message ] ) <EOL> class DateForm ( forms . Form ) : <EOL> """<STR_LIT>""" <EOL> start = forms . DateField ( input_formats = ( "<STR_LIT>" , ) ) <EOL> end = forms . DateField ( input_formats = ( "<STR_LIT>" , ) ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( DateForm , self ) . __init__ ( * args , ** kwargs ) <EOL> self . fields [ '<STR_LIT:start>' ] . widget . attrs [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> self . fields [ '<STR_LIT:end>' ] . widget . attrs [ '<STR_LIT>' ] = "<STR_LIT>" </s>
