#NEWLINE# def _get_model_from_node( self , node , attr ) : #NEWLINE# #INDENT# '\n        Helper to look up a model from a <object model=...> or a <field\n        rel=... to=...> node.\n        ' #NEWLINE# model_identifier = node . getAttribute ( node ) #NEWLINE# if ( not model_identifier ) : #NEWLINE# #INDENT# raise base . DeserializationError ( ( "<%s> node is missing the required '%s' attribute" % ( node . nodeName , attr ) ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# Model = models . get_model ( * model_identifier . split ( '.' ) ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# Model = None #NEWLINE# #UNINDENT# if ( Model is None ) : #NEWLINE# #INDENT# raise base . DeserializationError ( ( "<%s> node has invalid model identifier: '%s'" % ( node . nodeName , model_identifier ) ) ) #NEWLINE# #UNINDENT# return Model