shuup.admin.dashboard package
Submodules
shuup.admin.dashboard.blocks module
- class shuup.admin.dashboard.blocks.DashboardBlock(id, size=None, color=None, sort_order=0)[source]
Bases:
object
- SIZES = ('small', 'normal', 'medium', 'large', 'full')
- default_size = 'normal'
- sort_order = 0
- class shuup.admin.dashboard.blocks.DashboardContentBlock(id, content, size='normal')[source]
Bases:
DashboardBlock
- class shuup.admin.dashboard.blocks.DashboardValueBlock(id, value, title, **kwargs)[source]
Bases:
DashboardBlock
- default_size = 'small'
- class shuup.admin.dashboard.blocks.DashboardNumberBlock(id, value, title, **kwargs)[source]
Bases:
DashboardValueBlock
- class shuup.admin.dashboard.blocks.DashboardMoneyBlock(id, value, title, currency, **kwargs)[source]
Bases:
DashboardValueBlock
- class shuup.admin.dashboard.blocks.DashboardChartBlock(id, size='normal')[source]
Bases:
DashboardBlock
- default_size = 'medium'
- BLOCK_TEMPLATE = '\n <div class="color-block block-purple">\n <h2 class="block-title">%(title)s</h2>\n <div class="block-content">\n <canvas id="chart-%(id)s" height="250"></canvas>\n </div>\n </div>\n <script>\n window.CHART_CONFIGS = window.CHART_CONFIGS || {};\n window.CHART_CONFIGS["%(id)s"] = %(config)s;\n </script>\n '
shuup.admin.dashboard.charts module
- class shuup.admin.dashboard.charts.ChartType[source]
Bases:
object
Type of a chart
- BAR = 'bar'
- LINE = 'line'
- class shuup.admin.dashboard.charts.ChartDataType[source]
Bases:
object
Data type of datasets
- NUMBER = 'number'
- CURRENCY = 'currency'
- PERCENT = 'percent'
- class shuup.admin.dashboard.charts.Chart(title, data_type='number', locale=None, currency=None, options=None)[source]
Bases:
object
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- __init__(title, data_type='number', locale=None, currency=None, options=None)[source]
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- abstractmethod get_config()[source]
Get a JSONable dictionary of configuration data for this chart. This is passed on as
CHART_CONFIGS
in the JS environment and eventually processed bydashboard-charts.js
.- Returns:
Dict of configuration
- Return type:
- class shuup.admin.dashboard.charts.BarChart(title, labels, data_type='number', **kwargs)[source]
Bases:
Chart
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- __init__(title, labels, data_type='number', **kwargs)[source]
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- class shuup.admin.dashboard.charts.MixedChart(title, labels, data_type='number', **kwargs)[source]
Bases:
Chart
This chart supports both Bars and Lines.
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- __init__(title, labels, data_type='number', **kwargs)[source]
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
shuup.admin.dashboard.utils module
Module contents
- class shuup.admin.dashboard.BarChart(title, labels, data_type='number', **kwargs)[source]
Bases:
Chart
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- __init__(title, labels, data_type='number', **kwargs)[source]
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- class shuup.admin.dashboard.MixedChart(title, labels, data_type='number', **kwargs)[source]
Bases:
Chart
This chart supports both Bars and Lines.
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- __init__(title, labels, data_type='number', **kwargs)[source]
- Parameters:
title (str) – the title of the chart
data_type (ChartDataType) – the data type of values The chart will format the output labels according to this parameter
locale (str) – the locale to render values If not set, the locale will be fetched from Babel
currency (str) – the ISO-4217 code for the currency This is necessary when the data_type is CURRENCY
options (dict) – a dicionaty with options for Chartjs
- class shuup.admin.dashboard.ChartType[source]
Bases:
object
Type of a chart
- BAR = 'bar'
- LINE = 'line'
- class shuup.admin.dashboard.ChartDataType[source]
Bases:
object
Data type of datasets
- CURRENCY = 'currency'
- NUMBER = 'number'
- PERCENT = 'percent'
- class shuup.admin.dashboard.DashboardBlock(id, size=None, color=None, sort_order=0)[source]
Bases:
object
- SIZES = ('small', 'normal', 'medium', 'large', 'full')
- default_size = 'normal'
- sort_order = 0
- class shuup.admin.dashboard.DashboardChartBlock(id, size='normal')[source]
Bases:
DashboardBlock
- BLOCK_TEMPLATE = '\n <div class="color-block block-purple">\n <h2 class="block-title">%(title)s</h2>\n <div class="block-content">\n <canvas id="chart-%(id)s" height="250"></canvas>\n </div>\n </div>\n <script>\n window.CHART_CONFIGS = window.CHART_CONFIGS || {};\n window.CHART_CONFIGS["%(id)s"] = %(config)s;\n </script>\n '
- default_size = 'medium'
- class shuup.admin.dashboard.DashboardContentBlock(id, content, size='normal')[source]
Bases:
DashboardBlock
- class shuup.admin.dashboard.DashboardMoneyBlock(id, value, title, currency, **kwargs)[source]
Bases:
DashboardValueBlock
- class shuup.admin.dashboard.DashboardNumberBlock(id, value, title, **kwargs)[source]
Bases:
DashboardValueBlock
- class shuup.admin.dashboard.DashboardValueBlock(id, value, title, **kwargs)[source]
Bases:
DashboardBlock
- default_size = 'small'