#NEWLINE# def get_data( self , compact = True ) : #NEWLINE# #INDENT# "\n        Returns data representing current state of the form. While\n        Form.raw_data may contain alien fields and invalid data, this method\n        returns only valid fields that belong to this form only. It's designed\n        to pass somewhere current state of the form (as query string or by\n        other means).\n        " #NEWLINE# data = MultiDict ( ) #NEWLINE# for field in self . fields : #NEWLINE# #INDENT# raw_value = field . from_python ( self . python_data [ field . name ] ) #NEWLINE# field . set_raw_value ( data , raw_value ) #NEWLINE# #UNINDENT# if compact : #NEWLINE# #INDENT# data = MultiDict ( [ ( k , v ) for ( k , v ) in data . items ( ) if v ] ) #NEWLINE# #UNINDENT# return data