Skip to content

Commit

Permalink
Make form_data dict a macro (#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Apr 11, 2017
1 parent a803705 commit a0ddbb9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def get_query_str( # noqa / druid
orderby=None,
extras=None, # noqa
select=None, # noqa
columns=None, phase=2, client=None):
columns=None, phase=2, client=None, form_data=None):
"""Runs a query against Druid and returns a dataframe.
This query interface is common to SqlAlchemy and Druid
Expand Down
4 changes: 3 additions & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def get_sqla_query( # sqla
inner_to_dttm=None,
orderby=None,
extras=None,
columns=None):
columns=None,
form_data=None):
"""Querying any sqla table from this common interface"""

template_kwargs = {
Expand All @@ -355,6 +356,7 @@ def get_sqla_query( # sqla
'metrics': metrics,
'row_limit': row_limit,
'to_dttm': to_dttm,
'form_data': form_data,
}
template_processor = self.get_template_processor(**template_kwargs)

Expand Down
1 change: 1 addition & 0 deletions superset/jinja_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(self, database=None, query=None, table=None, **kwargs):
'url_param': url_param,
'current_user_id': current_user_id,
'current_username': current_username,
'form_data': {},
}
self.context.update(kwargs)
self.context.update(BASE_CONTEXT)
Expand Down
1 change: 1 addition & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def query_obj(self):
'timeseries_limit': limit,
'extras': extras,
'timeseries_limit_metric': timeseries_limit_metric,
'form_data': form_data,
}
return d

Expand Down

0 comments on commit a0ddbb9

Please sign in to comment.