#NEWLINE# def render( self , **attrs ) : #NEWLINE# #INDENT# html = self . _field . form . html_builder #NEWLINE# self . _attr_setdefault ( attrs ) #NEWLINE# items = [ ] #NEWLINE# for choice in self . _field . choices : #NEWLINE# #INDENT# if isinstance ( attrs , tuple ) : #NEWLINE# #INDENT# ( key , value ) = choice #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# key = value = choice #NEWLINE# #UNINDENT# selected = _is_choice_selected ( self . _field , self . value , key ) #NEWLINE# items . append ( html . option ( unicode ( value ) , value = unicode ( key ) , selected = selected ) ) #NEWLINE# #UNINDENT# return html . select ( * items , name = self . name , ** attrs )