superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: add title description to model view (#3045)
Date Wed, 26 Jul 2017 04:06:36 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7654eef  add title description to model view (#3045)
7654eef is described below

commit 7654eef11095f7210b680d43656d6cdfdf67b306
Author: Rogan <quangenw@gmail.com>
AuthorDate: Wed Jul 26 12:06:34 2017 +0800

    add title description to model view (#3045)
    
    * add title description to model view
    
    * add missing import
---
 superset/connectors/druid/views.py | 24 ++++++++++++++++++++++++
 superset/connectors/sqla/views.py  | 18 ++++++++++++++++++
 superset/views/core.py             | 18 ++++++++++++++++++
 superset/views/sql_lab.py          |  7 +++++++
 4 files changed, 67 insertions(+)

diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py
index 7ae3fb3..b9a87e3 100644
--- a/superset/connectors/druid/views.py
+++ b/superset/connectors/druid/views.py
@@ -24,6 +24,12 @@ from . import models
 
 class DruidColumnInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
     datamodel = SQLAInterface(models.DruidColumn)
+
+    list_title = _('List Druid Column')
+    show_title = _('Show Druid Column')
+    add_title = _('Add Druid Column')
+    edit_title = _('Edit Druid Column')
+
     edit_columns = [
         'column_name', 'description', 'dimension_spec_json', 'datasource',
         'groupby', 'filterable', 'count_distinct', 'sum', 'min', 'max']
@@ -70,6 +76,12 @@ appbuilder.add_view_no_menu(DruidColumnInlineView)
 
 class DruidMetricInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
     datamodel = SQLAInterface(models.DruidMetric)
+
+    list_title = _('List Druid Metric')
+    show_title = _('Show Druid Metric')
+    add_title = _('Add Druid Metric')
+    edit_title = _('Edit Druid Metric')
+
     list_columns = ['metric_name', 'verbose_name', 'metric_type']
     edit_columns = [
         'metric_name', 'description', 'verbose_name', 'metric_type', 'json',
@@ -112,6 +124,12 @@ appbuilder.add_view_no_menu(DruidMetricInlineView)
 
 class DruidClusterModelView(SupersetModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.DruidCluster)
+
+    list_title = _('List Druid Cluster')
+    show_title = _('Show Druid Cluster')
+    add_title = _('Add Druid Cluster')
+    edit_title = _('Edit Druid Cluster')
+
     add_columns = [
         'verbose_name', 'coordinator_host', 'coordinator_port',
         'coordinator_endpoint', 'broker_host', 'broker_port',
@@ -151,6 +169,12 @@ appbuilder.add_view(
 
 class DruidDatasourceModelView(DatasourceModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.DruidDatasource)
+
+    list_title = _('List Druid Datasource')
+    show_title = _('Show Druid Datasource')
+    add_title = _('Add Druid Datasource')
+    edit_title = _('Edit Druid Datasource')
+
     list_widget = ListWidgetWithCheckboxes
     list_columns = [
         'datasource_link', 'cluster', 'changed_by_', 'modified']
diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py
index cddd859..ef87d31 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -24,6 +24,12 @@ from . import models
 
 class TableColumnInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
     datamodel = SQLAInterface(models.TableColumn)
+
+    list_title = _('List Columns')
+    show_title = _('Show Column')
+    add_title = _('Add Column')
+    edit_title = _('Edit Column')
+
     can_delete = False
     list_widget = ListWidgetWithCheckboxes
     edit_columns = [
@@ -92,6 +98,12 @@ appbuilder.add_view_no_menu(TableColumnInlineView)
 
 class SqlMetricInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
     datamodel = SQLAInterface(models.SqlMetric)
+
+    list_title = _('List Metrics')
+    show_title = _('Show Metric')
+    add_title = _('Add Metric')
+    edit_title = _('Edit Metric')
+
     list_columns = ['metric_name', 'verbose_name', 'metric_type']
     edit_columns = [
         'metric_name', 'description', 'verbose_name', 'metric_type',
@@ -136,6 +148,12 @@ appbuilder.add_view_no_menu(SqlMetricInlineView)
 
 class TableModelView(DatasourceModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.SqlaTable)
+        
+    list_title = _('List Tables')
+    show_title = _('Show Table')
+    add_title = _('Add Table')
+    edit_title = _('Edit Table')
+
     list_columns = [
         'link', 'database',
         'changed_by_', 'modified']
diff --git a/superset/views/core.py b/superset/views/core.py
index 06a0c13..eded309 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -170,6 +170,12 @@ def generate_download_headers(extension):
 
 class DatabaseView(SupersetModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.Database)
+
+    list_title = _('List Databases')
+    show_title = _('Show Database')
+    add_title = _('Add Database')
+    edit_title = _('Edit Database')
+
     list_columns = [
         'database_name', 'backend', 'allow_run_sync', 'allow_run_async',
         'allow_dml', 'creator', 'modified']
@@ -319,6 +325,12 @@ appbuilder.add_view(
 
 class SliceModelView(SupersetModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.Slice)
+
+    list_title = _('List Slices')
+    show_title = _('Show Slice')
+    add_title = _('Add Slice')
+    edit_title = _('Edit Slice')
+
     can_add = False
     label_columns = {
         'datasource_link': 'Datasource',
@@ -415,6 +427,12 @@ appbuilder.add_view_no_menu(SliceAddView)
 
 class DashboardModelView(SupersetModelView, DeleteMixin):  # noqa
     datamodel = SQLAInterface(models.Dashboard)
+    
+    list_title = _('List Dashboards')
+    show_title = _('Show Dashboard')
+    add_title = _('Add Dashboard')
+    edit_title = _('Edit Dashboard')
+
     list_columns = ['dashboard_link', 'creator', 'modified']
     edit_columns = [
         'dashboard_title', 'slug', 'slices', 'owners', 'position_json', 'css',
diff --git a/superset/views/sql_lab.py b/superset/views/sql_lab.py
index 16a8dd2..03f382e 100644
--- a/superset/views/sql_lab.py
+++ b/superset/views/sql_lab.py
@@ -4,6 +4,7 @@ from flask_appbuilder import expose
 from flask_appbuilder.models.sqla.interface import SQLAInterface
 
 from flask_babel import gettext as __
+from flask_babel import lazy_gettext as _
 
 from superset import appbuilder
 from superset.models.sql_lab import Query, SavedQuery
@@ -25,6 +26,12 @@ appbuilder.add_view(
 
 class SavedQueryView(SupersetModelView, DeleteMixin):
     datamodel = SQLAInterface(SavedQuery)
+
+    list_title = _('List Saved Query')
+    show_title = _('Show Saved Query')
+    add_title = _('Add Saved Query')
+    edit_title = _('Edit Saved Query')
+
     list_columns = [
         'label', 'user', 'database', 'schema', 'description',
         'modified', 'pop_tab_link']

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message