Skip to content

Commit

Permalink
Adding expression column description in the CRUD
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Apr 12, 2016
1 parent 3d1fc99 commit af417b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class TableColumnInlineView(CompactCRUDMixin, CaravelModelView): # noqa
"Whether to make this column available as a "
"[Time Granularity] option, column has to be DATETIME or "
"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)

Expand Down Expand Up @@ -106,6 +109,11 @@ class SqlMetricInlineView(CompactCRUDMixin, CaravelModelView): # noqa
edit_columns = [
'metric_name', 'description', 'verbose_name', 'metric_type',
'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
page_size = 500
appbuilder.add_view_no_menu(SqlMetricInlineView)
Expand Down

0 comments on commit af417b6

Please sign in to comment.