#NEWLINE# def update_link_count( ) : #NEWLINE# #INDENT# 'increment link count in the `idx` column for the given document' #NEWLINE# link_count = frappe . cache ( ) . get_value ( '_link_count' ) #NEWLINE# if link_count : #NEWLINE# #INDENT# for ( key , count ) in link_count . iteritems ( ) : #NEWLINE# #INDENT# if ( key [ 0 ] not in ignore_doctypes ) : #NEWLINE# #INDENT# frappe . db . sql ( 'update `tab{0}` set idx = idx + {1} where name=%s' . format ( key [ 0 ] , count ) , key [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# frappe . cache ( ) . delete_value ( '_link_count' )