Skip to content

Commit

Permalink
[quickfix] fix broken CRUD column header links
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jun 30, 2016
1 parent fa65888 commit f407bd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def changed_by_fk(cls): # noqa
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 '')

Expand Down Expand Up @@ -168,7 +168,7 @@ def __repr__(self):
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
Expand Down Expand Up @@ -570,7 +570,7 @@ def html(self):
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)

Expand Down Expand Up @@ -1071,7 +1071,7 @@ def full_name(self):
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(
Expand Down
8 changes: 6 additions & 2 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -666,7 +668,9 @@ class LogModelView(CaravelModelView):
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',
Expand All @@ -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"),
Expand Down

0 comments on commit f407bd4

Please sign in to comment.