def setup_sidebar_items(data):
 if data.allow_sidebar_items:
  frappe.db.sql(u'update `tabPortal Menu Item` set enabled=0')
  frappe.db.sql(u'update `tabPortal Menu Item` set enabled=1\n DCTB  DCTB  DCTB where route in ({0})'.format(u', '.join([u'"{0}"'.format(d) for d in data.allow_sidebar_items])))
 if data.remove_sidebar_items:
  frappe.db.sql(u'update `tabPortal Menu Item` set enabled=1')
  frappe.db.sql(u'update `tabPortal Menu Item` set enabled=0\n DCTB  DCTB  DCTB where route in ({0})'.format(u', '.join([u'"{0}"'.format(d) for d in data.remove_sidebar_items])))

def setup_sidebar_items ( data ) : if data . allow_sidebar_items : frappe . db . sql ( u'update `tabPortal Menu Item` set enabled=0' ) frappe . db . sql ( u'update `tabPortal Menu Item` set enabled=1\n DCTB  DCTB  DCTB where route in ({0})' . format ( u', ' . join ( [ u'"{0}"' . format ( d ) for d in data . allow_sidebar_items ] ) ) ) if data . remove_sidebar_items : frappe . db . sql ( u'update `tabPortal Menu Item` set enabled=1' ) frappe . db . sql ( u'update `tabPortal Menu Item` set enabled=0\n DCTB  DCTB  DCTB where route in ({0})' . format ( u', ' . join ( [ u'"{0}"' . format ( d ) for d in data . remove_sidebar_items ] ) ) )
enable / disable sidebar items .