Skip to content

Commit

Permalink
Adding list of table names to show Dashboard view (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Jun 21, 2016
1 parent ff44e46 commit 7e8053a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ class Dashboard(Model, AuditMixinNullable):
def __repr__(self):
return self.dashboard_title

@property
def table_names(self):
return ", ".join({"{}".format(s.datasource) for s in self.slices})

@property
def url(self):
return "/caravel/dashboard/{}/".format(self.slug or self.id)
Expand Down
2 changes: 2 additions & 0 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ class DashboardModelView(CaravelModelView, DeleteMixin): # noqa
edit_columns = [
'dashboard_title', 'slug', 'slices', 'owners', 'position_json', 'css',
'json_metadata']
show_columns = edit_columns + ['table_names']
add_columns = edit_columns
base_order = ('changed_on', 'desc')
description_columns = {
Expand Down Expand Up @@ -541,6 +542,7 @@ class DashboardModelView(CaravelModelView, DeleteMixin): # noqa
'position_json': _("Position JSON"),
'css': _("CSS"),
'json_metadata': _("JSON Metadata"),
'table_names': _("Underlying Tables"),
}

def pre_add(self, obj):
Expand Down

0 comments on commit 7e8053a

Please sign in to comment.