mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-09-24 22:36:33 +00:00
tweaks to choices
This commit is contained in:
@@ -623,8 +623,6 @@ def changedetection_app(config=None, datastore_o=None):
|
||||
|
||||
visualselector_data_is_ready = datastore.visualselector_data_is_ready(uuid)
|
||||
|
||||
|
||||
|
||||
# Only works reliably with Playwright
|
||||
visualselector_enabled = os.getenv('PLAYWRIGHT_DRIVER_URL', False) and default['fetch_backend'] == 'html_webdriver'
|
||||
|
||||
|
||||
@@ -103,21 +103,16 @@ class MultiCheckboxDayOfWeekField(SelectMultipleField):
|
||||
widget = widgets.ListWidget(prefix_label=False)
|
||||
option_widget = widgets.CheckboxInput()
|
||||
|
||||
def _choices_generator(self, choices):
|
||||
_choices = []
|
||||
i=0
|
||||
for d in ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']:
|
||||
_choices.append((i, d))
|
||||
i += 1
|
||||
|
||||
for value, label in _choices:
|
||||
selected = self.data is not None and self.coerce(value) in self.data
|
||||
yield (value, label, selected)
|
||||
|
||||
class TimeScheduleCheckLimitForm(Form):
|
||||
day_of_week = MultiCheckboxDayOfWeekField('',coerce=int)
|
||||
from_time = TimeField('From')
|
||||
until_time = TimeField('Until')
|
||||
# @todo must be a better python way todo this c/i list
|
||||
c=[]
|
||||
i=0
|
||||
for d in ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']:
|
||||
c.append((i, d))
|
||||
i+=1
|
||||
day_of_week = MultiCheckboxDayOfWeekField('',coerce=int, choices=c)
|
||||
from_time = TimeField('From', validators=[validators.Optional()])
|
||||
until_time = TimeField('Until', validators=[validators.Optional()])
|
||||
|
||||
# Separated by key:value
|
||||
class StringDictKeyValue(StringField):
|
||||
|
||||
Reference in New Issue
Block a user