Skip to main content

system.kanoa.dashboard.addWidgetCategory

This function is part of the kanoaCore module

Description

Creates a new widget category

Syntax

addWidgetCategory(categoryInfo, userId)
  • Parameters
      categoryInfo (dict)
      - widgetCategoryName (string): The name of the category
      - widgetCategoryDescription (string): Some information about the widget category
      - enabled (bool)
      userId (int)
  • Returns
      widgetCategoryId (int)
      msg (string): error message, None if successful
  • Code Examples

    # Example usage
    userId = 123
    categoryInfo = {
    "widgetCategoryName": "Analysis",
    "widgetCategoryDescription": "Contains analysis style widgets",
    "enabled": True
    }
    widgetCategoryId, msg = system.kanoa.dashboard.addWidgetCategory(categoryInfo, userId)
    if msg: system.perspective.sendMessage('showFailerToast', msg)
    else: system.perspective.sendMessage('showSuccessfulToast', 'Widget Category has been saved')