New hidden: True option for table metadat, closes #239

This commit is contained in:
Simon Willison 2018-04-25 20:42:57 -07:00
commit 02ee31c8b4
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
4 changed files with 31 additions and 10 deletions

View file

@ -90,6 +90,7 @@ METADATA = {
},
'no_primary_key': {
'sortable_columns': [],
'hidden': True,
},
'units': {
'units': {

View file

@ -17,7 +17,7 @@ def test_homepage(app_client):
assert response.json.keys() == {'test_tables': 0}.keys()
d = response.json['test_tables']
assert d['name'] == 'test_tables'
assert d['tables_count'] == 15
assert d['tables_count'] == 14
def test_database_page(app_client):
@ -113,14 +113,6 @@ def test_database_page(app_client):
},
'label_column': None,
'primary_keys': ['pk'],
}, {
'columns': ['content', 'a', 'b', 'c'],
'name': 'no_primary_key',
'count': 201,
'hidden': False,
'foreign_keys': {'incoming': [], 'outgoing': []},
'label_column': None,
'primary_keys': [],
}, {
'columns': ['id', 'content', 'content2'],
'name': 'primary_key_multiple_columns',
@ -213,6 +205,14 @@ def test_database_page(app_client):
'foreign_keys': {'incoming': [], 'outgoing': []},
'label_column': None,
'primary_keys': ['pk'],
}, {
'columns': ['content', 'a', 'b', 'c'],
'name': 'no_primary_key',
'count': 201,
'hidden': True,
'foreign_keys': {'incoming': [], 'outgoing': []},
'label_column': None,
'primary_keys': [],
}] == data['tables']