mirror of https://github.com/apache/superset.git
Make form_data dict a macro (#2585)
This commit is contained in:
parent
a803705ddc
commit
a0ddbb9ec9
|
@ -709,7 +709,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||||
orderby=None,
|
orderby=None,
|
||||||
extras=None, # noqa
|
extras=None, # noqa
|
||||||
select=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.
|
"""Runs a query against Druid and returns a dataframe.
|
||||||
|
|
||||||
This query interface is common to SqlAlchemy and Druid
|
This query interface is common to SqlAlchemy and Druid
|
||||||
|
|
|
@ -346,7 +346,8 @@ class SqlaTable(Model, BaseDatasource):
|
||||||
inner_to_dttm=None,
|
inner_to_dttm=None,
|
||||||
orderby=None,
|
orderby=None,
|
||||||
extras=None,
|
extras=None,
|
||||||
columns=None):
|
columns=None,
|
||||||
|
form_data=None):
|
||||||
"""Querying any sqla table from this common interface"""
|
"""Querying any sqla table from this common interface"""
|
||||||
|
|
||||||
template_kwargs = {
|
template_kwargs = {
|
||||||
|
@ -355,6 +356,7 @@ class SqlaTable(Model, BaseDatasource):
|
||||||
'metrics': metrics,
|
'metrics': metrics,
|
||||||
'row_limit': row_limit,
|
'row_limit': row_limit,
|
||||||
'to_dttm': to_dttm,
|
'to_dttm': to_dttm,
|
||||||
|
'form_data': form_data,
|
||||||
}
|
}
|
||||||
template_processor = self.get_template_processor(**template_kwargs)
|
template_processor = self.get_template_processor(**template_kwargs)
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ class BaseTemplateProcessor(object):
|
||||||
'url_param': url_param,
|
'url_param': url_param,
|
||||||
'current_user_id': current_user_id,
|
'current_user_id': current_user_id,
|
||||||
'current_username': current_username,
|
'current_username': current_username,
|
||||||
|
'form_data': {},
|
||||||
}
|
}
|
||||||
self.context.update(kwargs)
|
self.context.update(kwargs)
|
||||||
self.context.update(BASE_CONTEXT)
|
self.context.update(BASE_CONTEXT)
|
||||||
|
|
|
@ -178,6 +178,7 @@ class BaseViz(object):
|
||||||
'timeseries_limit': limit,
|
'timeseries_limit': limit,
|
||||||
'extras': extras,
|
'extras': extras,
|
||||||
'timeseries_limit_metric': timeseries_limit_metric,
|
'timeseries_limit_metric': timeseries_limit_metric,
|
||||||
|
'form_data': form_data,
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue