Skip to content

Commit

Permalink
Cosmetric tweaks in the CRUD list view (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 12, 2016
1 parent 52bbb38 commit f28c2b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def creator(self): # noqa
def changed_by_(self):
return '{}'.format(self.changed_by or '')

@renders('changed_on')
def changed_on_(self):
return '<span class="no-wrap">{}</span>'.format(self.changed_on)

@renders('changed_on')
def modified(self):
s = humanize.naturaltime(datetime.now() - self.changed_on)
Expand Down
4 changes: 2 additions & 2 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class DruidMetricInlineView(CompactCRUDMixin, CaravelModelView): # noqa

class DatabaseView(CaravelModelView, DeleteMixin): # noqa
datamodel = SQLAInterface(models.Database)
list_columns = ['database_name', 'sql_link', 'creator', 'changed_on']
list_columns = ['database_name', 'sql_link', 'creator', 'changed_on_']
add_columns = [
'database_name', 'sqlalchemy_uri', 'cache_timeout', 'extra']
search_exclude_columns = ('password',)
Expand Down Expand Up @@ -235,7 +235,7 @@ class TableModelView(CaravelModelView, DeleteMixin): # noqa
datamodel = SQLAInterface(models.SqlaTable)
list_columns = [
'table_link', 'database', 'sql_link', 'is_featured',
'changed_by_', 'changed_on', 'perm']
'changed_by_', 'changed_on_']
add_columns = [
'table_name', 'database', 'schema',
'default_endpoint', 'offset', 'cache_timeout']
Expand Down

0 comments on commit f28c2b2

Please sign in to comment.