def delete_child_rows(rows, doctype):
 for p in list(set([r[1] for r in rows])):
  if p:
   frappe.db.sql(u'delete from `tab{0}` where parent=%s'.format(doctype), p)

def delete_child_rows ( rows , doctype ) : for p in list ( set ( [ r [ 1 ] for r in rows ] ) ) : if p : frappe . db . sql ( u'delete from `tab{0}` where parent=%s' . format ( doctype ) , p )
delete child rows for all parents .