#NEWLINE# def object_deflate( self , obj , **kwargs ) : #NEWLINE# #INDENT# 'Add object caching' #NEWLINE# cache_key = ( 'api_%s_%d' % ( self . __class__ . __name__ , obj . pk ) ) #NEWLINE# data = self . _meta . cache . get ( obj ) #NEWLINE# if ( data is None ) : #NEWLINE# #INDENT# data = super ( CachedSerialiser , self ) . object_deflate ( obj , ** kwargs ) #NEWLINE# timeout = getattr ( self . _meta , 'timeout' , None ) #NEWLINE# self . _meta . cache . set ( data , timeout = timeout ) #NEWLINE# #UNINDENT# return data