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-
type= None¶
-
SIZES= ('small', 'normal', 'medium', 'large', 'full')¶
-
default_size= 'normal'¶
-
sort_order= 0¶
-
-
class
shuup.admin.dashboard.blocks.DashboardContentBlock(id, content, size='normal')[source]¶ Bases:
shuup.admin.dashboard.blocks.DashboardBlock-
type= 'normal'¶
-
-
class
shuup.admin.dashboard.blocks.DashboardValueBlock(id, value, title, **kwargs)[source]¶ Bases:
shuup.admin.dashboard.blocks.DashboardBlock-
type= 'value'¶
-
default_size= 'small'¶
-
-
class
shuup.admin.dashboard.blocks.DashboardMoneyBlock(id, value, title, currency, **kwargs)[source]¶
-
class
shuup.admin.dashboard.blocks.DashboardChartBlock(id, size='normal')[source]¶ Bases:
shuup.admin.dashboard.blocks.DashboardBlock-
type= 'chart'¶
-
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:
objectType of a chart
-
BAR= 'bar'¶
-
LINE= 'line'¶
-
-
class
shuup.admin.dashboard.charts.ChartDataType[source]¶ Bases:
objectData 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:
objectParameters: - 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
-
supported_chart_types= []¶
-
get_config()[source]¶ Get a JSONable dictionary of configuration data for this chart. This is passed on as
CHART_CONFIGSin the JS environment and eventually processed bydashboard-charts.js.Returns: Dict of configuration Return type: dict
-
class
shuup.admin.dashboard.charts.BarChart(title, labels, data_type='number', **kwargs)[source]¶ Bases:
shuup.admin.dashboard.charts.Chart-
supported_chart_types= ['bar']¶
-
shuup.admin.dashboard.utils module¶
Module contents¶
-
class
shuup.admin.dashboard.BarChart(title, labels, data_type='number', **kwargs)[source]¶ Bases:
shuup.admin.dashboard.charts.Chart-
supported_chart_types= ['bar']¶
-
-
class
shuup.admin.dashboard.MixedChart(title, labels, data_type='number', **kwargs)[source]¶ Bases:
shuup.admin.dashboard.charts.ChartThis chart supports both Bars and Lines.
-
supported_chart_types= ['bar', 'line']¶
-
-
class
shuup.admin.dashboard.ChartType[source]¶ Bases:
objectType of a chart
-
BAR= 'bar'¶
-
LINE= 'line'¶
-
-
class
shuup.admin.dashboard.ChartDataType[source]¶ Bases:
objectData 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¶
-
type= None¶
-
-
class
shuup.admin.dashboard.DashboardChartBlock(id, size='normal')[source]¶ Bases:
shuup.admin.dashboard.blocks.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'¶
-
get_chart()[source]¶ Get the actual chart instance for this block.
Returns: The chart (or None, if it can’t be rendered) Return type: shuup.admin.dashboard.charts.Chart|None
-
type= 'chart'¶
-
-
class
shuup.admin.dashboard.DashboardContentBlock(id, content, size='normal')[source]¶ Bases:
shuup.admin.dashboard.blocks.DashboardBlock-
type= 'normal'¶
-
-
class
shuup.admin.dashboard.DashboardValueBlock(id, value, title, **kwargs)[source]¶ Bases:
shuup.admin.dashboard.blocks.DashboardBlock-
default_size= 'small'¶
-
type= 'value'¶
-