mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Adding template_params to datasource editor for sqla tables (#6869)
This commit is contained in:
parent
49868748e6
commit
b0f7f51ab7
@ -448,6 +448,14 @@ export class DatasourceEditor extends React.PureComponent {
|
||||
label={t('Hours offset')}
|
||||
control={<TextControl />}
|
||||
/>
|
||||
{ this.state.isSqla &&
|
||||
<Field
|
||||
fieldKey="template_params"
|
||||
label={t('Template parameters')}
|
||||
descr={t('A set of parameters that become available in the query using Jinja templating syntax')}
|
||||
control={<TextControl />}
|
||||
/>
|
||||
}
|
||||
</Fieldset>);
|
||||
}
|
||||
|
||||
|
@ -431,6 +431,7 @@ class SqlaTable(Model, BaseDatasource):
|
||||
d['time_grain_sqla'] = grains
|
||||
d['main_dttm_col'] = self.main_dttm_col
|
||||
d['fetch_values_predicate'] = self.fetch_values_predicate
|
||||
d['template_params'] = self.template_params
|
||||
return d
|
||||
|
||||
def values_for_column(self, column_name, limit=10000):
|
||||
|
Loading…
Reference in New Issue
Block a user