diff --git a/panoramix/forms.py b/panoramix/forms.py index 13c3bb559d188..d4cd8a3ad9198 100644 --- a/panoramix/forms.py +++ b/panoramix/forms.py @@ -185,6 +185,18 @@ def __init__(self, viz): "The time granularity for the visualization. Note that you " "can define arbitrary expression that return a DATETIME " "column in the table editor")), + 'resample_rule': FreeFormSelectField( + 'Resample Rule', default='', + choices=self.choicify(('1M', '1H', '1D', '7D', '1M', '1Y')), + description=("Pandas resample rule")), + 'resample_how': FreeFormSelectField( + 'Resample How', default='', + choices=self.choicify(('', 'avg', 'sum',)), + description=("Pandas resample how")), + 'resample_fillmethod': FreeFormSelectField( + 'Resample Fill Method', default='', + choices=self.choicify(('', 'ffill', 'bfill')), + description=("Pandas resample fill method")), 'since': FreeFormSelectField( 'Since', default="7 days ago", choices=self.choicify([ @@ -426,11 +438,12 @@ class QueryForm(OmgWtForm): TextField("Super", default='')) for fieldset in viz.fieldsetizer(): for ff in fieldset['fields']: - if isinstance(ff, string_types): - ff = [ff] - for s in ff: - if s: - setattr(QueryForm, s, px_form_fields[s]) + if ff: + if isinstance(ff, string_types): + ff = [ff] + for s in ff: + if s: + setattr(QueryForm, s, px_form_fields[s]) # datasource type specific form elements diff --git a/panoramix/templates/panoramix/explore.html b/panoramix/templates/panoramix/explore.html index dbca1763fabe3..618b831287137 100644 --- a/panoramix/templates/panoramix/explore.html +++ b/panoramix/templates/panoramix/explore.html @@ -69,7 +69,9 @@ {% endif %}