mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
[quickfix] fix broken CRUD column header links
This commit is contained in:
parent
fa65888590
commit
f407bd45fd
@ -83,11 +83,11 @@ class AuditMixinNullable(AuditMixin):
|
||||
Integer, ForeignKey('ab_user.id'),
|
||||
default=cls.get_user_id, onupdate=cls.get_user_id, nullable=True)
|
||||
|
||||
@renders('created_by')
|
||||
@renders('created_on')
|
||||
def creator(self): # noqa
|
||||
return '{}'.format(self.created_by or '')
|
||||
|
||||
@renders('changed_by')
|
||||
@property
|
||||
def changed_by_(self):
|
||||
return '{}'.format(self.changed_by or '')
|
||||
|
||||
@ -168,7 +168,7 @@ class Slice(Model, AuditMixinNullable):
|
||||
def datasource(self):
|
||||
return self.table or self.druid_datasource
|
||||
|
||||
@property
|
||||
@renders('datasource_name')
|
||||
def datasource_link(self):
|
||||
if self.table:
|
||||
return self.table.link
|
||||
@ -570,7 +570,7 @@ class SqlaTable(Model, Queryable, AuditMixinNullable):
|
||||
def name(self):
|
||||
return self.table_name
|
||||
|
||||
@property
|
||||
@renders('table_name')
|
||||
def table_link(self):
|
||||
return '<a href="{obj.explore_url}">{obj.table_name}</a>'.format(obj=self)
|
||||
|
||||
@ -1071,7 +1071,7 @@ class DruidDatasource(Model, AuditMixinNullable, Queryable):
|
||||
def __repr__(self):
|
||||
return self.datasource_name
|
||||
|
||||
@property
|
||||
@renders('datasource_name')
|
||||
def datasource_link(self):
|
||||
url = "/caravel/explore/{obj.type}/{obj.id}/".format(obj=self)
|
||||
return '<a href="{url}">{obj.datasource_name}</a>'.format(
|
||||
|
@ -409,6 +409,8 @@ class TableModelView(CaravelModelView, DeleteMixin): # noqa
|
||||
list_columns = [
|
||||
'table_link', 'database', 'sql_link', 'is_featured',
|
||||
'changed_by_', 'changed_on_']
|
||||
order_columns = [
|
||||
'table_link', 'database', 'sql_link', 'is_featured', 'changed_on_']
|
||||
add_columns = [
|
||||
'table_name', 'database', 'schema',
|
||||
'default_endpoint', 'offset', 'cache_timeout']
|
||||
@ -666,7 +668,9 @@ appbuilder.add_view(
|
||||
class DruidDatasourceModelView(CaravelModelView, DeleteMixin): # noqa
|
||||
datamodel = SQLAInterface(models.DruidDatasource)
|
||||
list_columns = [
|
||||
'datasource_link', 'cluster', 'changed_by_', 'modified', 'offset']
|
||||
'datasource_link', 'cluster', 'changed_by_', 'changed_on_', 'offset']
|
||||
order_columns = [
|
||||
'datasource_link', 'changed_on_', 'offset']
|
||||
related_views = [DruidColumnInlineView, DruidMetricInlineView]
|
||||
edit_columns = [
|
||||
'datasource_name', 'cluster', 'description', 'owner',
|
||||
@ -682,7 +686,7 @@ class DruidDatasourceModelView(CaravelModelView, DeleteMixin): # noqa
|
||||
"https://daringfireball.net/projects/markdown/'>markdown</a>"),
|
||||
}
|
||||
label_columns = {
|
||||
'datasource_name': _("Data Source"),
|
||||
'datasource_link': _("Data Source"),
|
||||
'cluster': _("Cluster"),
|
||||
'description': _("Description"),
|
||||
'owner': _("Owner"),
|
||||
|
Loading…
Reference in New Issue
Block a user