#NEWLINE# def render( self , context ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# expire_time = self . expire_time_var . resolve ( context ) #NEWLINE# #UNINDENT# except VariableDoesNotExist : #NEWLINE# #INDENT# raise TemplateSyntaxError ( ( '"cache" tag got an unknown variable: %r' % self . expire_time_var . var ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# expire_time = int ( expire_time ) #NEWLINE# #UNINDENT# except ( ValueError , TypeError ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( ( '"cache" tag got a non-integer timeout value: %r' % expire_time ) ) #NEWLINE# #UNINDENT# args = md5_constructor ( ':' . join ( [ urlquote ( resolve_variable ( var , context ) ) for var in self . vary_on ] ) ) #NEWLINE# cache_key = ( 'template.cache.%s.%s' % ( self . fragment_name , args . hexdigest ( ) ) ) #NEWLINE# value = cache . get ( cache_key ) #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# value = self . nodelist . render ( context ) #NEWLINE# cache . set ( cache_key , value , expire_time ) #NEWLINE# #UNINDENT# return value