def update_comments_in_parent(reference_doctype, reference_name, _comments):
 if ((not reference_doctype) or frappe.db.get_value(u'DocType', reference_doctype, u'issingle')):
  return
 try:
  frappe.db.sql((u'update `tab%s` set `_comments`=%s where name=%s' % (reference_doctype, u'%s', u'%s')), (json.dumps(_comments), reference_name))
 except Exception as e:
  if ((e.args[0] == 1054) and getattr(frappe.local, u'request', None)):
   frappe.local._comments = (getattr(frappe.local, u'_comments', []) + [(reference_doctype, reference_name, _comments)])
  else:
   raise ImplicitCommitError
 else:
  if (not frappe.flags.in_patch):
   reference_doc = frappe.get_doc(reference_doctype, reference_name)
   if getattr(reference_doc, u'route', None):
    clear_cache(reference_doc.route)

def update_comments_in_parent ( reference_doctype , reference_name , _comments ) : if ( ( not reference_doctype ) or frappe . db . get_value ( u'DocType' , reference_doctype , u'issingle' ) ) : return try : frappe . db . sql ( ( u'update `tab%s` set `_comments`=%s where name=%s' % ( reference_doctype , u'%s' , u'%s' ) ) , ( json . dumps ( _comments ) , reference_name ) ) except Exception as e : if ( ( e . args [ 0 ] == 1054 ) and getattr ( frappe . local , u'request' , None ) ) : frappe . local . _comments = ( getattr ( frappe . local , u'_comments' , [ ] ) + [ ( reference_doctype , reference_name , _comments ) ] ) else : raise ImplicitCommitError else : if ( not frappe . flags . in_patch ) : reference_doc = frappe . get_doc ( reference_doctype , reference_name ) if getattr ( reference_doc , u'route' , None ) : clear_cache ( reference_doc . route )
updates _comments property in parent document with given dict .