mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Display full table name (schema + name) if possible. (#1728)
This commit is contained in:
parent
7f4f250970
commit
1a16491971
@ -435,7 +435,8 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
|
||||
|
||||
@property
|
||||
def table_names(self):
|
||||
return ", ".join({"{}".format(s.datasource) for s in self.slices})
|
||||
return ", ".join(
|
||||
{"{}".format(s.datasource.name) for s in self.slices})
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
@ -896,7 +897,7 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin):
|
||||
name='_customer_location_uc'),)
|
||||
|
||||
def __repr__(self):
|
||||
return self.table_name
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def description_markeddown(self):
|
||||
@ -904,9 +905,9 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin):
|
||||
|
||||
@property
|
||||
def link(self):
|
||||
table_name = escape(self.table_name)
|
||||
name = escape(self.name)
|
||||
return Markup(
|
||||
'<a href="{self.explore_url}">{table_name}</a>'.format(**locals()))
|
||||
'<a href="{self.explore_url}">{name}</a>'.format(**locals()))
|
||||
|
||||
@property
|
||||
def schema_perm(self):
|
||||
@ -920,7 +921,9 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
if not self.schema:
|
||||
return self.table_name
|
||||
return "{}.{}".format(self.schema, self.table_name)
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
|
@ -701,7 +701,7 @@ class TableModelView(SupersetModelView, DeleteMixin): # noqa
|
||||
"Table [{}] could not be found, "
|
||||
"please double check your "
|
||||
"database connection, schema, and "
|
||||
"table name".format(table.table_name))
|
||||
"table name".format(table.name))
|
||||
|
||||
def post_add(self, table):
|
||||
table.fetch_metadata()
|
||||
|
Loading…
Reference in New Issue
Block a user