#NEWLINE# def serialize( self , request , content_type , default_serializers = None ) : #NEWLINE# #INDENT# 'Serializes the wrapped object.\n\n        Utility method for serializing the wrapped object.  Returns a\n        webob.Response object.\n        ' #NEWLINE# if self . serializer : #NEWLINE# #INDENT# serializer = self . serializer #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( _mtype , _serializer ) = self . get_serializer ( content_type , default_serializers ) #NEWLINE# serializer = _serializer ( ) #NEWLINE# #UNINDENT# response = webob . Response ( ) #NEWLINE# response . status_int = self . code #NEWLINE# for ( hdr , value ) in self . _headers . items ( ) : #NEWLINE# #INDENT# response . headers [ hdr ] = utils . utf8 ( str ( _mtype ) ) #NEWLINE# #UNINDENT# response . headers [ 'Content-Type' ] = utils . utf8 ( content_type ) #NEWLINE# if ( self . obj is not None ) : #NEWLINE# #INDENT# response . body = serializer . serialize ( self . obj ) #NEWLINE# #UNINDENT# return response