Widget Decorators¶
The widget decorators can be applied to widgets to configure them in some fashion:
from dashboard.widget import *
import time
@refresh_every(5)
async def my_widget(wc):
return { "time": time.time() }
-
dashboard.widget.methods(methods)[source]¶ Widget wrapper that sets the widget to refresh every
frequencyseconds.The
frequencyis available asfrequencyin the widget options in the index template.A widget with a
frequencyofNoneshould be refreshed at the default interval. A widget with afrequencyof0should never be refreshed. A widget with afrequencyofnshould be refreshed everynseconds.
-
dashboard.widget.refresh_every(frequency)[source]¶ Widget wrapper that sets the widget to refresh every
frequencyseconds.The
frequencyis available asfrequencyin the widget options in the index template.A widget with a
frequencyofNoneshould be refreshed at the default interval. A widget with afrequencyof0should never be refreshed. A widget with afrequencyofnshould be refreshed everynseconds.