dash.contrib.plugins.weather package

Submodules

dash.contrib.plugins.weather.apps module

class dash.contrib.plugins.weather.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'dash.contrib.plugins.weather'
name = 'dash.contrib.plugins.weather'

dash.contrib.plugins.weather.conf module

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

Get a setting from dash.contrib.plugins.weather 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.contrib.plugins.weather.dash_plugins module

class dash.contrib.plugins.weather.dash_plugins.BaseWeatherPlugin(layout_uid, placeholder_uid, workspace=None, user=None, position=None)[source]

Bases: dash.base.BaseDashboardPlugin

Base Weather plugin.

form

alias of WeatherForm

group = <django.utils.functional.__proxy__ object at 0x7f10ff3a55d0>
name = <django.utils.functional.__proxy__ object at 0x7f10ff3a5590>
post_processor()[source]

If no text available, use dummy.

dash.contrib.plugins.weather.dash_widgets module

class dash.contrib.plugins.weather.dash_widgets.BaseWeatherWidget(plugin)[source]

Bases: dash.base.BaseDashboardPluginWidget

Base weather plugin widget.

media_css = ['css/dash_plugin_weather.css']
render(request=None)[source]
class dash.contrib.plugins.weather.dash_widgets.Weather2x2Widget(plugin)[source]

Bases: dash.contrib.plugins.weather.dash_widgets.BaseWeatherWidget

Weather plugin 2x2 widget.

cols = 2
plugin_uid = 'weather_2x2'
rows = 2
class dash.contrib.plugins.weather.dash_widgets.Weather3x3Widget(plugin)[source]

Bases: dash.contrib.plugins.weather.dash_widgets.BaseWeatherWidget

Weather plugin 3x3 widget.

cols = 3
plugin_uid = 'weather_3x3'
rows = 3

dash.contrib.plugins.weather.defaults module

dash.contrib.plugins.weather.forms module

class dash.contrib.plugins.weather.forms.WeatherForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form, dash.base.DashboardPluginFormBase

Form for main WeatherPlugin.

base_fields = OrderedDict([('custom_title', <django.forms.fields.CharField object at 0x7f10ff3a5090>), ('show_feed_title', <django.forms.fields.BooleanField object at 0x7f10ff3a5150>), ('cache_for', <django.forms.fields.IntegerField object at 0x7f10ff3a5210>), ('public_ip', <django.forms.fields.CharField object at 0x7f10ff3a52d0>), ('weather_data_json', <django.forms.fields.CharField object at 0x7f10ff3a5390>)])
declared_fields = OrderedDict([('custom_title', <django.forms.fields.CharField object at 0x7f10ff3a5090>), ('show_feed_title', <django.forms.fields.BooleanField object at 0x7f10ff3a5150>), ('cache_for', <django.forms.fields.IntegerField object at 0x7f10ff3a5210>), ('public_ip', <django.forms.fields.CharField object at 0x7f10ff3a52d0>), ('weather_data_json', <django.forms.fields.CharField object at 0x7f10ff3a5390>)])
media
plugin_data_fields = [('custom_title', ''), ('show_title', True), ('cache_for', 3600), ('public_ip', ''), ('weather_data_json', '')]
save_plugin_data(request=None)[source]

For showing the weather, we need an IP address. Although we don’t make it possible for the user to specify it manually, we silently obtain it and save into the plugin data.

dash.contrib.plugins.weather.settings module

Module contents