#NEWLINE# def start_object( self , obj ) : #NEWLINE# #INDENT# '\n        Called as each object is handled.\n        ' #NEWLINE# if ( not hasattr ( obj , '_meta' ) ) : #NEWLINE# #INDENT# raise base . SerializationError ( ( 'Non-model object (%s) encountered during serialization' % type ( obj ) ) ) #NEWLINE# #UNINDENT# self . indent ( 1 ) #NEWLINE# self . xml . startElement ( 'object' , { #NEWLINE# #INDENT# 'pk' : smart_unicode ( obj . _get_pk_val ( ) ) , #NEWLINE# 'model' : smart_unicode ( obj . _meta ) , #NEWLINE# #UNINDENT# } )