from wtforms import ( BooleanField, validators, FloatField ) from changedetectionio.forms import processor_text_json_diff_form class processor_settings_form(processor_text_json_diff_form): in_stock_only = BooleanField('Only trigger when product goes BACK to in-stock', default=True) price_change_min = FloatField('Minimum amount to trigger notification', [validators.Optional()], render_kw={"placeholder": "No limit", "size": "10"}) price_change_max = FloatField('Maximum amount to trigger notification', [validators.Optional()], render_kw={"placeholder": "No limit", "size": "10"}) price_change_threshold_percent = FloatField('Threshold in % for price changes', validators=[ validators.Optional(), validators.NumberRange(min=0, max=100, message="Should be between 0 and 100"), ], render_kw={"placeholder": "0%", "size": "5"}) follow_price_changes = BooleanField('Follow price changes', default=False) def extra_tab_content(self): return 'Restock & Price Detection' def extra_form_content(self): return """ {% from '_helpers.html' import render_field, render_checkbox_field, render_button %}
"""