

def add_link(self, name, href='', icon='', label='', category='', category_icon='', category_label='', baseview=None):
    label = (label or name)
    category_label = (category_label or category)
    if (category == ''):
        self.menu.append(MenuItem(name=name, href=href, icon=icon, label=label, baseview=baseview))
    else:
        menu_item = self.find(category)
        if menu_item:
            new_menu_item = MenuItem(name=name, href=href, icon=icon, label=label, baseview=baseview)
            menu_item.childs.append(new_menu_item)
        else:
            self.add_category(category=category, icon=category_icon, label=category_label)
            new_menu_item = MenuItem(name=name, href=href, icon=icon, label=label, baseview=baseview)
            self.find(category).childs.append(new_menu_item)

dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/menu.py Menu.add_link/original