From e1cd275aa372f72d26b729ee172f3abafdd8bd02 Mon Sep 17 00:00:00 2001 From: Ali Cirik Date: Tue, 5 Sep 2017 21:11:33 -0400 Subject: [PATCH] Make columns that return an exception on click unsortable. --- superset/connectors/druid/views.py | 1 + superset/connectors/sqla/views.py | 1 + superset/views/core.py | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py index a06bc391ff355..d17260b1c7c1d 100644 --- a/superset/connectors/druid/views.py +++ b/superset/connectors/druid/views.py @@ -178,6 +178,7 @@ class DruidDatasourceModelView(DatasourceModelView, DeleteMixin): # noqa list_widget = ListWidgetWithCheckboxes list_columns = [ 'datasource_link', 'cluster', 'changed_by_', 'modified'] + order_columns = ['datasource_link', 'modified'] related_views = [DruidColumnInlineView, DruidMetricInlineView] edit_columns = [ 'datasource_name', 'cluster', 'slices', 'description', 'owner', diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py index c49d4d02a56dd..13c8bd58fc76b 100644 --- a/superset/connectors/sqla/views.py +++ b/superset/connectors/sqla/views.py @@ -160,6 +160,7 @@ class TableModelView(DatasourceModelView, DeleteMixin): # noqa list_columns = [ 'link', 'database', 'changed_by_', 'modified'] + order_columns = ['modified'] add_columns = ['database', 'schema', 'table_name'] edit_columns = [ 'table_name', 'sql', 'filter_select_enabled', 'slices', diff --git a/superset/views/core.py b/superset/views/core.py index 68e82027d0658..c43f1c6c4d905 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -179,6 +179,10 @@ class DatabaseView(SupersetModelView, DeleteMixin): # noqa list_columns = [ 'database_name', 'backend', 'allow_run_sync', 'allow_run_async', 'allow_dml', 'creator', 'modified'] + order_columns = [ + 'database_name', 'allow_run_sync', 'allow_run_async', 'allow_dml', + 'modified' + ] add_columns = [ 'database_name', 'sqlalchemy_uri', 'cache_timeout', 'extra', 'expose_in_sqllab', 'allow_run_sync', 'allow_run_async', @@ -305,7 +309,7 @@ class AccessRequestsModelView(SupersetModelView, DeleteMixin): list_columns = [ 'username', 'user_roles', 'datasource_link', 'roles_with_datasource', 'created_on'] - order_columns = ['username', 'datasource_link'] + order_columns = ['created_on'] base_order = ('changed_on', 'desc') label_columns = { 'username': _("User"), @@ -342,6 +346,7 @@ class SliceModelView(SupersetModelView, DeleteMixin): # noqa ) list_columns = [ 'slice_link', 'viz_type', 'datasource_link', 'creator', 'modified'] + order_columns = ['viz_type', 'datasource_link', 'modified'] edit_columns = [ 'slice_name', 'description', 'viz_type', 'owners', 'dashboards', 'params', 'cache_timeout'] @@ -436,6 +441,7 @@ class DashboardModelView(SupersetModelView, DeleteMixin): # noqa edit_title = _('Edit Dashboard') list_columns = ['dashboard_link', 'creator', 'modified'] + order_columns = ['modified'] edit_columns = [ 'dashboard_title', 'slug', 'slices', 'owners', 'position_json', 'css', 'json_metadata']