dash package

Subpackages

Submodules

dash.admin module

dash.base module

All uids are supposed to be pythonic function names (see PEP http://www.python.org/dev/peps/pep-0008/#function-names).

class dash.base.BaseDashboardLayout(user=None)[source]

Bases: object

Base layout.

Layouts consist of placeholders.

Properties:
  • uid (string): Layout unique identifier (globally).
  • name (string): Layout name.
  • description (string): Layout description.
  • placeholders (iterable): Iterable (list, tuple or set) of ``dash.base.BaseDashboardPlaceholder` subclasses.
  • view_template_name (string): Temlate used to render the layout (view).
  • edit_template_name (string): Template used to render the layout (edit).
  • plugin_widgets_template_name_ajax (string): Temlate used to render the plugin widgets popup.
  • form_snippet_template_name (string): Template used to render the forms.
  • html_classes (string): Extra HTML class that layout should get.
  • cell_units (string):
  • media_css (list): List all specific stylesheets.
  • media_js (list): List all specific javascripts.
cell_units = None
collect_widget_media(dashboard_entries)[source]

Collects the widget media files.

Parameters:dashboard_entries (iterable) – Iterable of dash.models.DashboardEntry instances.
Return list:
description = None
edit_template_name = None
edit_template_name_ajax = None
form_snippet_template_name = 'dash/snippets/generic_form_snippet.html'
get_css(placeholders)[source]

Gets placeholder specific css.

Parameters:placeholders (iterable) – Iterable of dash.base.BaseDashboardPlaceholder subclassed instances.
Return string:
get_edit_template_name(request=None)[source]
get_grouped_dashboard_entries(dashboard_entries)[source]

Gets dashboard entries grouped by placeholder.

Parameters:dashboard_entries (iterable) – Iterable of dash.models.DashboardEntry objects.
Return list:
get_media_css()[source]

Gets all CSS media files (for the layout + plugins).

Return list:
get_media_js()[source]

Gets all JavaScript media files (for the layout + plugins).

Return list:
get_placeholder(uid, default=None)[source]
get_placeholder_instances(dashboard_entries=None, workspace=None, request=None)[source]

Gets placeholder instances.

Parameters:
  • dashboard_entries (iterable) – Iterable of dash.models.DashboardEntry objects.
  • request (django.http.HttpRequest) –
Return list:

List of dash.base.BaseDashboardPlaceholder subclassed instances.

get_placeholder_uids(request=None)[source]

Gets the list of placeholder uids.

Parameters:request (django.http.HttpRequest) –
Return list:
get_placeholders(request=None)[source]

Gets the list of placeholders registered for the layout.

Parameters:request (django.http.HttpRequest) –
Return itetable:
 List of placeholder classes. Override in your layout if you need a custom behaviour.
get_view_template_name(request=None, origin=None)[source]

Gets the view template name.

Parameters:
  • request (django.http.HttpRequest) –
  • origin (string) – Origin of the request. Hook to provide custom templates for apps. Example value: ‘public_dashboard’. Take the public_dashboard app as example.
html_class[source]

Class used in the HTML.

Return string:
html_classes = []
media_css = []
media_js = []
name = None
placeholders = []
plugin_widgets_template_name_ajax = 'dash/plugin_widgets_ajax.html'
primary_html_class[source]
render_for_edit(dashboard_entries=None, workspace=None, request=None)[source]

Renders the layout.

NOTE: This is not used at the moment. You most likely want the dash.views.edit_dashboard view.

Parameters:
  • dashboard_entries (iterable) –
  • workspace (string) – Current workspace.
  • request (django.http.HttpRequest) –
Return string:
render_for_view(dashboard_entries=None, workspace=None, request=None)[source]

Renders the layout.

NOTE: This is not used at the moment. You most likely want the dash.views.dashboard view.

Parameters:
  • dashboard_entries (iterable) –
  • workspace (string) – Current workspace.
  • request (django.http.HttpRequest) –
Return string:
uid = None
view_template_name = None
view_template_name_ajax = None
class dash.base.BaseDashboardPlaceholder(layout)[source]

Bases: object

Base placeholder.

Properties:
  • uid (string): Unique identifier (shouldn’t repeat within a single layout).
  • cols (int): Number of cols in the placeholder.
  • rows (int): Number of rows in the placeholder.
  • cell_width (int): Single cell (1x1) width.
  • cell_height (int): Single cell (1x1) height.
  • cell_margin_top (int): Top margin of a single cell.
  • cell_margin_right (int): Right margin of a single cell.
  • cell_margin_bottom (int): Bottom margin of a single cell.
  • cell_margin_left (int): Left margin of a single cell.
  • view_template_name (string): Template to be used for rendering the placeholder in view mode.
  • edit_template_name (string): Template to be used for rendering the placeholder in edit mode.
  • html_classes (string): Extra HTML class that layout should get.
cell_height = None
cell_margin_bottom = 0
cell_margin_left = 0
cell_margin_right = 0
cell_margin_top = 0
cell_units[source]
cell_width = None
cols = None
css[source]

CSS styles for the placeholders and plugins. The placeholder dimensions as well as columns sizes, should be handled here. Since we are in a placeholder and a placeholder has a defined number of rows and columns and each reneder has just a fixed amount of rows and columns defined, we can render the top left corners generic css classes.

Cells do NOT have margins or paddings. This is essential (since all the plugins are positioned absolutely). If you want to have padding in your plugin widget, specify the plugin-content-wrapper class style in your specific layout/theme.

Example:
.placeholder .plugin .plugin-content-wrapper {

padding: 5px;

}

Return string:
edit_template_name = ''
get_cell_height()[source]

Gets a single cell height, with respect to margins.

Return int:
get_cell_width()[source]

Gets a single cell width, with respect to margins.

Return int:
get_edit_template_name()[source]
get_view_template_name()[source]
html_class[source]

Class used in the HTML.

Return string:
html_classes = []
html_id[source]

ID used in the HTML. Unique.

Return string:
load_dashboard_entries(dashboard_entries=None)[source]

Feed the dashboard entries to the layout for rendering later.

Parameters:dashboard_entries (iterable) – Iterable of dash.models.DashboardEntry objects.
primary_html_class[source]
render_for_edit()[source]

Renders the placeholder for edit mode.

Parameters:
  • workspace (string) – Current workspace slug.
  • request (django.http.HttpRequest) –
Return string:
render_for_view()[source]

Renders the placeholder for view mode.

Return string:
rows = None
uid = None
view_template_name = ''
widget_inner_height(rows)[source]

The inner height of the widget to be rendered.

Return int:
widget_inner_width(cols)[source]

The inner width of the widget to be rendered.

class dash.base.BaseDashboardPlugin(layout_uid, placeholder_uid, workspace=None, user=None, position=None)[source]

Bases: object

Base dashboard plugin from which every plugin should inherit.

Properties:
  • uid (string): Plugin uid (obligatory). Example value: ‘dummy’, ‘wysiwyg’, ‘news’.
  • name (string): Plugin name (obligatory). Example value: ‘Dummy plugin’, ‘WYSIWYG’, ‘Latest news’.
  • description (string): Plugin decription (optional). Example value: ‘Dummy plugin used just for testing’.
  • help_text (string): Plugin help text (optional). This text would be shown in dash.views.add_dashboard_entry and dash.views.edit_dashboard_entry views.
  • form: Plugin form (optional). A subclass of django.forms.Form. Should be given in case plugin is configurable.
  • add_form_template (str) (optional): Add form template (optional). If given, overrides the dash.views.add_dashboard_entry default template.
  • edit_form_template (string): Edit form template (optional). If given, overrides the dash.views.edit_dashboard_entry default template.
  • html_classes (list): List of extra HTML classes for the plugin.
  • group (string): Plugin are grouped under the specified group. Override in your plugin if necessary.
add_form_template = None
clone_plugin_data(dashboard_entry)[source]

Used when copying entries. If any objects or files are created by plugin, they should be cloned.

Parameters:dash.models.DashboardEntry – Instance of dash.models.DashboardEntry.
Return string:JSON dumped string of the cloned plugin data. The returned value would be inserted as is into the dash.models.DashboardEntry.plugin_data field.
delete_plugin_data()[source]

Used in dash.views.delete_dashboard_entry. Fired automatically, when dash.models.DashboardEntry object is about to be deleted. Make use of it if your plugin creates database records or files that are not monitored externally but by dash only.

description = None
edit_form_template = None
form = None
get_cloned_plugin_data(update={})[source]

Get the cloned plugin data and returns it in a JSON dumped format.

Parameters:update (dict) –
Return string:JSON dumped string of the cloned plugin data.
Example:

In the get_cloned_plugin_data method of your plugin, do as follows:

>>> def clone_plugin_data(self, dashboard_entry):
>>>     cloned_image = clone_file(self.data.image, relative_path=True)
>>>     return self.get_cloned_plugin_data(update={'image': cloned_image})
get_form()[source]

Get the plugin form class. Override this method in your subclassed dash.base.DashboardPlugin class when you need your plugin setup to vary depending on the placeholder, workspace, user or request given. By default returns the value of the form attribute defined in your plugin.

Return django.forms.Form|django.forms.ModelForm:
 Subclass of django.forms.Form or django.forms.ModelForm.
get_initialised_create_form(data=None, files=None)[source]

Used dash.views.add_dashboard_entry view to gets initialised form for object to be created.

get_initialised_create_form_or_404(data=None, files=None)[source]

Same as get_initialised_create_form but raises django.http.Http404 on errors.

get_initialised_edit_form(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)[source]

Used in dash.views.edit_dashboard_entry view.

get_initialised_edit_form_or_404(data=None, files=None, auto_id='id_%s', prefix=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=':', empty_permitted=False)[source]

Same as get_initialised_edit_form but raises django.http.Http404 on errors.

get_instance()[source]
get_plugin_form_data()[source]

Fed as initial argument to the plugin form when initialising the instance for adding or editing the plugin. Override in your plugin class if you need customisations.

get_position()[source]

Gets the exact position of the plugin widget in the placeholder (row number, col number).

Return tuple:Tuple of row and col numbers.
get_updated_plugin_data(update={})[source]

Get the plugin data and returns it in a JSON dumped format.

Parameters:update (dict) –
Return string:JSON dumped string of the cloned plugin data.
get_widget(request=None, as_instance=False)[source]

Gets the plugin widget.

Parameters:
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
Return mixed:

Subclass of dash.base.BaseDashboardPluginWidget or instance of subclassed dash.base.BaseDashboardPluginWidget object.

group = 'General'
help_text = None
html_class[source]

A massive work on positioning the plugin and having it to be displayed in a given width is done here. We should be getting the plugin widget for the plugin given and based on its’ properties (static!) as well as on plugin position (which we have from model), we can show the plugin with the exact class.

html_classes = []
html_id[source]
load_plugin_data(plugin_data)[source]

Loads the plugin data saved in dash.models.DashboardEntry. Plugin data is saved in JSON string.

Parameters:plugin_data (string) – JSON string with plugin data.
name = None
post_processor()[source]

Redefine in your subclassed plugin when necessary.

Post process plugin data here (before rendering). This methid is being called after the data has been loaded into the plugin.

Note, that request (django.http.HttpRequest) is available (self.request).

pre_processor()[source]

Redefine in your subclassed plugin when necessary.

Pre process plugin data (before rendering). This method is being called before the data has been loaded into the plugin.

Note, that request (django.http.HttpRequest) is available (self.request).

process(plugin_data=None, fetch_related_data=False)[source]

Init plugin with data.

process_plugin_data(fetch_related_data=False)[source]

Processes the plugin data.

render(request=None)[source]

Renders the plugin HTML (for dashboard workspace).

Parameters:request (django.http.HttpRequest) –
Return string:
save_plugin_data(dashboard_entry, plugin_data)[source]

Save plugin data. Used in bulk update plugin data.

Parameters:
  • dashboard_entry (dash.models.DashboardEntry) –
  • plugin_data (dict) –
Return bool:

True if all went well.

uid = None
update_plugin_data(dashboard_entry)[source]

Used in dash.management.commands.dash_update_plugin_data.

Some plugins would contain data fetched from various sources (models, remote data). Since dashboard entries are by definition loaded extremely much, you are advised to store as much data as possible in plugin_data field of dash.models.DashboardEntry. Some externally fetched data becomes invalid after some time and needs updating. For that purpose, in case if your plugin needs that, redefine this method in your plugin. If you need your data to be periodically updated, add a cron-job which would run dash_update_plugin_data management command (see dash.management.commands.dash_update_plugin_data module).

Parameters:dash.models.DashboardEntry – Instance of dash.models.DashboardEntry.
Return dict:Should return a dictionary containing data of fields to be updated.
class dash.base.BaseDashboardPluginWidget(plugin)[source]

Bases: object

Base plugin widget.

So, if we would want to register a plugin widget (renderer) for some layout, we would first define the plugin widget and then just write:

>>> plugin_widget_registry.register(DummyPluginWidget)

Plugin widget is always being registered for a placeholder. Placeholder in its’ turn has number of rows and columns. Since we register each widget for a (layout, placeholder, plugin) combination separately, it fits the needs and requirements perfectly. In that way we are able to tell, wheither plugin has a widget available and actually valid (qua dimensions) for the placeholder. Plugin is just data. Nothing more. Widget operates with that data. Thus, widget has number of rows and columns it occupies in the placeholder registered. By default, number of rows and columns is set to 1, which means that a plugin occupies just 1 cell. But, certainly, there can be plugins that occupy more space in a placeholder.

cols = 1
get_height()[source]

Gets widget height.

Return int:
get_size(delta_width=0, delta_height=0)[source]

Gets widget size.

Parameters:
  • delta_width (int) –
  • delta_height (int) –
Return tuple:
get_width()[source]

Gets widget width.

Return int:
html_class = ''[source]
html_classes = []
layout_uid = None
media_css = []
media_js = []
placeholder_uid = None
plugin_uid = None
render(request=None)[source]
rows = 1
dash.base.get_registered_plugins()[source]

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.

Return list:
dash.base.get_registered_plugin_uids()[source]

Gets a list of registered plugin uids as a list . If not yet autodiscovered, autodiscovers them.

Return list:
dash.base.validate_plugin_uid(plugin_uid)[source]

Validates the plugin uid.

Parameters:plugin_uid (string) –
Return bool:
dash.base.get_registered_layouts()[source]

Gets registered layouts.

dash.base.get_registered_layout_uids()[source]

Gets uids of registered layouts.

dash.base.get_layout(layout_uid=None, as_instance=False)[source]

Gets the layout by layout_uid given. If left empty, takes the default one chosen in settings.

Raises a dash.exceptions.NoActiveLayoutChosen when no default layout could be found.

Return dash.base.BaseDashboardLayout:
 Sublcass of dash.base.BaseDashboardLayout.
dash.base.validate_placeholder_uid(layout, placeholder_uid)[source]

Validates the placeholder.

Parameters:
  • layout_uid (string) –
  • placeholder_uid (string) –
Return bool:
dash.base.ensure_autodiscover()[source]

Ensures that plugins are autodiscovered.

class dash.base.DashboardPluginFormBase[source]

Bases: object

Not a form actually. Defined for magic only.

Property iterable plugin_data_fields:
 

Fields to get when calling the get_plugin_data method. These field will be JSON serialized. All other fields, even if they are part of the form, won’t be. Make sure all fields are serializable. If some of them aren’t, override the save_plugin_data method and make them serializable there. See dash.contrib.plugins.image.forms as a good example.

Example:
>>> plugin_data_fields = (
>>>    ('name', ''),
>>>    ('active': False)
>>> )
get_plugin_data(request=None)[source]

Data that would be saved in the plugin_data field of the dash.models.DashboardEntry subclassed model.

Parameters:request (django.http.HttpRequest) –
plugin_data_fields = None
save_plugin_data(request=None)[source]

Dummy, but necessary.

dash.base.collect_widget_media(dashboard_entries)[source]

Collects the widget media for dashboard entries given.

Parameters:dashboard_entries (iterable) – Iterable of dash.models.DashboardEntry instances.
Return dict:Returns a dict containing the ‘js’ and ‘css’ keys. Correspondent values of those keys are lists containing paths to the CSS and JS media files.

dash.clipboard module

dash.compat module

dash.conf module

dash.conf.get_setting(setting, override=None)[source]

Get a setting from dash conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

dash.constants module

dash.decorators module

dash.decorators.permissions_required(perms, satisfy='all', login_url=None, raise_exception=False)[source]

Checks for the permissions given based on the strategy chosen.

Parameters:
  • perms (iterable) –
  • satisfy (string) – Allowed values are “all” and “any”.
  • login_url (string) –
  • raise_exception (bool) – If set to True, the PermissionDenied exception is raised on failures.
Return bool:
Example:
>>> @login_required
>>> @permissions_required(satisfy='any', perms=[
>>>     'dash.add_dashboardentry', 'dash.change_dashboardentry', 'dash.delete_dashboardentry',
>>>     'dash.add_dashboardworkspace', 'dash.change_dashboardworkspace', 'dash.delete_dashboardworkspace',
>>>     'dash.add_dashboardsettings', 'dash.change_dashboardsettings', 'dash.delete_dashboardsettings',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code
dash.decorators.all_permissions_required(perms, login_url=None, raise_exception=False)[source]
Example:
>>> @login_required
>>> @all_permissions_required([
>>>     'dash.add_dashboardentry', 'dash.change_dashboardentry', 'dash.delete_dashboardentry',
>>>     'dash.add_dashboardworkspace', 'dash.change_dashboardworkspace', 'dash.delete_dashboardworkspace',
>>>     'dash.add_dashboardsettings', 'dash.change_dashboardsettings', 'dash.delete_dashboardsettings',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code
dash.decorators.any_permission_required(perms, login_url=None, raise_exception=False)[source]
Example:
>>> @login_required
>>> @any_permission_required([
>>>     'dash.add_dashboardentry', 'dash.change_dashboardentry', 'dash.delete_dashboardentry',
>>>     'dash.add_dashboardworkspace', 'dash.change_dashboardworkspace', 'dash.delete_dashboardworkspace',
>>>     'dash.add_dashboardsettings', 'dash.change_dashboardsettings', 'dash.delete_dashboardsettings',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code
dash.decorators.edit_dashboard_permission_required(login_url=None, raise_exception=False)[source]

Checks if user has permissions to edit dashboard. Simply, check is successfull if any of the following permission checks are satisfied:

  • Can add dashboard entry
  • Can change dashboard entry
  • Can delete dashboard entry
  • Can add dashboard workspace
  • Can change dashboard workspace
  • Can delete dashboard workspace
  • Can add dashboard settings
  • Can change dashboard settings
  • Can delete dashboard settings
Example:
>>> @login_required
>>> @edit_dashboard_permission_required() # Do not forget the brackets!
>>> def edit_dashboard(request):
>>>     # your code

dash.defaults module

dash.discover module

dash.discover.autodiscover()[source]

Autodiscovers files that should be found by dash.

dash.exceptions module

exception dash.exceptions.BaseException[source]

Bases: exceptions.Exception

Base django-dash exception.

exception dash.exceptions.InvalidRegistryItemType[source]

Bases: exceptions.ValueError

Raised when an attempt is made to register an item in the registry which does not have a proper type.

exception dash.exceptions.LayoutDoesNotExist[source]

Bases: dash.exceptions.BaseException

Raised when layout does not exist.

exception dash.exceptions.PluginWidgetOutOfPlaceholderBoundaries[source]

Bases: dash.exceptions.BaseException

Raised when plugin widget is out of placeholder boundaries.

exception dash.exceptions.ImproperlyConfigured[source]

Bases: dash.exceptions.BaseException

Raised when django-dash is somehow improperly configured.

dash.factory module

dash.factory.plugin_factory(base_class, plugin_uid_prefix, sizes=[])[source]

Plugin factory.

Parameters:
  • base_class (dash.base.BaseDashboardWidget) – Subclass of.
  • layout_uid (string) –
  • placeholder_uid (string) –
  • plugin_uid_prefix (string) –
  • sizes (iterable) – Iterable of tuples.
Example:
>>> from dash.contrib.plugins.image.dash_plugins import BaseImagePlugin
>>> plugin_factory(BaseImagePlugin, 'image', zip(range(6, 10), range(6, 10)))

The example above will update the plugin registry with the following dictionary: >>> { >>> ‘image_6x6’: dash.factory.Plugin, >>> ‘image_7x7’: dash.factory.Plugin, >>> ‘image_8x8’: dash.factory.Plugin, >>> ‘image_9x9’: dash.factory.Plugin, >>> }

The generated class (one of them), would look as follows:

>>> class Plugin(BaseImagePlugin):
>>>     uid = 'image_6x6'

The uid property is generated automatically.

dash.factory.plugin_widget_factory(base_class, layout_uid, placeholder_uid, plugin_uid_prefix, sizes=[])[source]

Plugin widget factory.

Parameters:
  • base_class (dash.base.BaseDashboardWidget) – Subclass of.
  • layout_uid (string) – Layout UID, for which widgets are generated.
  • placeholder_uid (string) – Placeholder UID, for which widets are generated.
  • plugin_uid_prefix (string) – Prefix of the plugin UID.
  • sizes (iterable) – Iterable of tuples.
Example:
>>> from dash.contrib.plugins.image.dash_widgets import BaseImageWidget
>>> plugin_widget_factory(BaseImageWidget, 'android', 'main', 'image', zip(range(6, 10), range(6, 10)))

The example above will update the plugin widget registry with the following dictionary:

>>> {
>>>     'android.main.image_6x6': dash.factory.Widget,
>>>     'android.main.image_7x7': dash.factory.Widget,
>>>     'android.main.image_8x8': dash.factory.Widget,
>>>     'android.main.image_9x9': dash.factory.Widget,
>>> }

The generated class (one of them), would look as follows:

>>> class Widget(BaseImageWidget):
>>>     layout_uid = 'android'
>>>     placeholder_uid = 'main'
>>>     plugin_uid = 'image_6x6'
>>>     cols = 6
>>>     rows = 6

The layout_uid, placeholder_uid, plugin_uid, cols and rows properties are generated automatically.

dash.fields module

class dash.fields.OrderField(verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class django.db.models.fields.NOT_PROVIDED at 0x7f10ffd5bef0>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text=u'', db_column=None, db_tablespace=None, auto_created=False, validators=, []error_messages=None)[source]

Bases: django.db.models.fields.IntegerField

@author http://djangosnippets.org/users/zenx/ @source http://djangosnippets.org/snippets/1861/

OrderField for models from http://ianonpython.blogspot.com/2008/08/orderfield-for-django-models.html and updated to use a django aggregation function. This field sets a default value as an auto-increment of the maximum value of the field +1.

Ignores the incoming value and instead gets the maximum plus one of the field.

This works really well in combination with “sortable_list.js”. There are several things you should know:
  • order field shall be null=True, blank=True
  • order field shall not be unique

If above mentioned is True, you can use jQuery drag-n-drop widget in your Django-admin. See the following example:

class Media: # This belongs to your Admin class (admin.ModelAdmin)
js = [
‘/media/js/jquery-1.6.2.min.js’, ‘/media/js/jquery-ui-1.8.16.custom.min.js’, ‘/media/js/sortable_list.js’

]

formfield_(**kwargs)[source]
pre_save(model_instance, value)[source]

dash.forms module

dash.helpers module

dash.helpers.slugify_workspace(s)
dash.helpers.lists_overlap(sub, main)[source]
dash.helpers.iterable_to_dict(items, key_attr_name)[source]

Converts iterable of certain objects to dict.

Parameters:
  • items (iterable) –
  • key_attr_name (string) – Attribute to use as a dictionary key.
Return dict:
dash.helpers.uniquify_sequence(sequence)[source]

Makes sure items in the given sequence are unique, having the original order preserved.

Parameters:sequence (iterable) –
Return list:
dash.helpers.clean_plugin_data(dashboard_entries, request=None)[source]

Cleans up the plugin data (database, files) for the dashboard_entries given.

Parameters:
  • dashboard_entries (iterable) –
  • request (django.http.HttpRequest) –
Return bool:

Boolean True if no errors occured and False otherwise.

dash.helpers.clone_plugin_data(dashboard_entry, request=None)[source]

Clone plugin data of a dashboard entry.

dash.helpers.update_plugin_data(dashboard_entry, request=None)[source]

Update plugin data of a dashboard entry.

dash.helpers.safe_text(text)[source]

Safe text (encode).

Return str:

dash.json_package module

dash.models module

dash.settings module

  • RESTRICT_PLUGIN_ACCESS (bool): If set to True, (Django) permission system for dash plugins is enabled.
  • PLUGINS_MODULE_NAME (str): Name of the module to placed in the (external) apps in which the dash plugin code should be implemented and registered.
  • ACTIVE_LAYOUT (str): Active layout UID.
  • LAYOUTS_MODULE_NAME (str): Name of the python module to be placed in (external) apps in which the dash layouts should be implemented and registered.
  • DEFAULT_WORKSPACE_NAME (str): Name of the default workspace.
  • DEFAULT_PLACEHOLDER_VIEW_TEMPLATE_NAME (str): Default template name for the placeholder view.
  • DEFAULT_PLACEHOLDER_EDIT_TEMPLATE_NAME (str): Default template name for the placeholder edit.
  • LAYOUT_CELL_UNITS (str): Layout cell units. Allowed values are em, px, pt, %.
  • DISPLAY_AUTH_LINK (bool): If set to True, the log in or log out link is shown in the Dash drop-down menu.
  • DEBUG (bool)

dash.tests module

dash.urls module

dash.utils module

dash.views module

dash.widgets module

class dash.widgets.BooleanRadioSelect(*args, **kwargs)[source]

Bases: django.forms.widgets.RadioSelect

Boolean radio select for Django.

Example:
>>> class DummyForm(forms.Form):
>>>     agree = forms.BooleanField(label=_("Agree?"), required=False, widget=BooleanRadioSelect)
media

Module contents