mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Adding expression column description in the CRUD
This commit is contained in:
parent
3d1fc99353
commit
af417b6b58
@ -78,6 +78,9 @@ class TableColumnInlineView(CompactCRUDMixin, CaravelModelView): # noqa
|
|||||||
"Whether to make this column available as a "
|
"Whether to make this column available as a "
|
||||||
"[Time Granularity] option, column has to be DATETIME or "
|
"[Time Granularity] option, column has to be DATETIME or "
|
||||||
"DATETIME-like"),
|
"DATETIME-like"),
|
||||||
|
'expression': utils.markdown(
|
||||||
|
"a valid SQL expression as supported by the underlying backend. "
|
||||||
|
"Example: `substr(name, 1, 1)`", True),
|
||||||
}
|
}
|
||||||
appbuilder.add_view_no_menu(TableColumnInlineView)
|
appbuilder.add_view_no_menu(TableColumnInlineView)
|
||||||
|
|
||||||
@ -106,6 +109,11 @@ class SqlMetricInlineView(CompactCRUDMixin, CaravelModelView): # noqa
|
|||||||
edit_columns = [
|
edit_columns = [
|
||||||
'metric_name', 'description', 'verbose_name', 'metric_type',
|
'metric_name', 'description', 'verbose_name', 'metric_type',
|
||||||
'expression', 'table']
|
'expression', 'table']
|
||||||
|
description_columns = {
|
||||||
|
'expression': utils.markdown(
|
||||||
|
"a valid SQL expression as supported by the underlying backend. "
|
||||||
|
"Example: `count(DISTINCT userid)`", True),
|
||||||
|
}
|
||||||
add_columns = edit_columns
|
add_columns = edit_columns
|
||||||
page_size = 500
|
page_size = 500
|
||||||
appbuilder.add_view_no_menu(SqlMetricInlineView)
|
appbuilder.add_view_no_menu(SqlMetricInlineView)
|
||||||
|
Loading…
Reference in New Issue
Block a user