#NEWLINE# def _handle_object( self , node ) : #NEWLINE# #INDENT# '\n        Convert an <object> node to a DeserializedObject.\n        ' #NEWLINE# Model = self . _get_model_from_node ( node , 'model' ) #NEWLINE# pk = node . getAttribute ( 'pk' ) #NEWLINE# if ( not pk ) : #NEWLINE# #INDENT# raise base . DeserializationError ( "<object> node is missing the 'pk' attribute" ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# Model . _meta . pk . attname : Model . _meta . pk . to_python ( pk ) , #NEWLINE# #UNINDENT# } #NEWLINE# m2m_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for field_node in node . getElementsByTagName ( 'field' ) : #NEWLINE# #INDENT# field_name = field_node . getAttribute ( 'name' ) #NEWLINE# if ( not field_name ) : #NEWLINE# #INDENT# raise base . DeserializationError ( "<field> node is missing the 'name' attribute" ) #NEWLINE# #UNINDENT# field = Model . _meta . get_field ( field_name ) #NEWLINE# if ( field . rel and isinstance ( field . rel , models . ManyToManyRel ) ) : #NEWLINE# #INDENT# m2m_data [ field . name ] = self . _handle_m2m_field_node ( field_node , field ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( field . rel and isinstance ( field . rel , models . ManyToOneRel ) ) : #NEWLINE# #INDENT# data [ field . attname ] = self . _handle_fk_field_node ( field_node , field ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if field_node . getElementsByTagName ( 'None' ) : #NEWLINE# #INDENT# value = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = field . to_python ( getInnerText ( field_node ) . strip ( ) ) #NEWLINE# #UNINDENT# data [ field . name ] = value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return base . DeserializedObject ( Model ( ** data ) , m2m_data )