#NEWLINE# def prepare_select( self , field ) : #NEWLINE# #INDENT# field_attrs = field . build_field_attrs ( ) #NEWLINE# widget_attrs = field . build_widget_attrs ( ) #NEWLINE# field_attrs . update ( { #NEWLINE# #INDENT# 'widget' : forms . Select ( attrs = widget_attrs ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# if field . choice_values : #NEWLINE# #INDENT# choice_list = field . get_choices ( ) #NEWLINE# if ( not field . required ) : #NEWLINE# #INDENT# choice_list . insert ( 0 , ( '' , ( field . placeholder_text or _ ( 'Please select an option' ) ) ) ) #NEWLINE# #UNINDENT# field_attrs . update ( { #NEWLINE# #INDENT# 'choices' : choice_list , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return forms . ChoiceField ( ** field_attrs )