Skip to main content

system.kanoa.dashboard.getWidgetFilters

This function is part of the kanoaCore module

Description

This function will parse the widget view parameters and either grab the assetPath and date range from the global session properties or set them to the passed in values.

Syntax

getWidgetFilters(paramsDict, userId)
  • Parameters
      page (dict): page.props.pageId
      viewParams (dict)
      sessionCustomProps (dict): pass in the session custom props dictionary for 'session.custom.kanoa'
      clientTZ (string): i.e 'America/Los Angeles'
  • Returns
      filters (dict)
  • Code Examples

    # Example usage
    filters = system.kanoa.dashboard.getWidgetFilters({page.props.pageId}, {view.params.value}, {session.custom.kanoa}, self.session.props.device.timezone.id)
    print filters
    > {
    "assetId": 510,
    "assetPath": "Kanoa Industries\Buffalo Bakery\Production\Mix Line 1",
    "autoUpdateTimerSeconds": None,
    "dateRange": {
    "endDate": Mon Jul 08 18:33:35 UTC 2024,,
    "selectedRange": "Today",
    "startDate": Sun Jul 07 18:33:35 UTC 2024,
    },
    "showAssetPath": True
    }
    >