def update_link_count():
 link_count = frappe.cache().get_value(u'_link_count')
 if link_count:
  for (key, count) in link_count.iteritems():
   if (key[0] not in ignore_doctypes):
    try:
     frappe.db.sql(u'update `tab{0}` set idx = idx + {1} where name=%s'.format(key[0], count), key[1])
    except Exception as e:
     if (e.args[0] != 1146):
      raise e
 frappe.cache().delete_value(u'_link_count')

def update_link_count ( ) : link_count = frappe . cache ( ) . get_value ( u'_link_count' ) if link_count : for ( key , count ) in link_count . iteritems ( ) : if ( key [ 0 ] not in ignore_doctypes ) : try : frappe . db . sql ( u'update `tab{0}` set idx = idx + {1} where name=%s' . format ( key [ 0 ] , count ) , key [ 1 ] ) except Exception as e : if ( e . args [ 0 ] != 1146 ) : raise e frappe . cache ( ) . delete_value ( u'_link_count' )
increment link count in the idx column for the given document .