#NEWLINE# def read( self , request ) : #NEWLINE# #INDENT# iso_code = request . GET . get ( 'country' , '' ) #NEWLINE# json = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# form_class = form_factory ( country_code = iso_code ) #NEWLINE# form_obj = form_class ( ) #NEWLINE# for ( k , v ) in form_obj . fields . items ( ) : #NEWLINE# #INDENT# if ( k not in json . keys ( ) ) : #NEWLINE# #INDENT# json [ k ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# json [ k ] [ 'label' ] = unicode ( self . label ) #NEWLINE# json [ k ] [ 'widget' ] = v . widget . render ( k , '' , attrs = { #NEWLINE# #INDENT# 'id' : ( 'id_' + k ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return json