Don't show hidden tables on index page, closes #455

Refs #460. Also bulked out HTML index page unit tests.
This commit is contained in:
Simon Willison 2019-05-14 08:46:57 -07:00
commit e04511410f
3 changed files with 68 additions and 6 deletions

View file

@ -52,7 +52,9 @@ class IndexView(RenderMixin):
else hashlib.md5(name.encode("utf8")).hexdigest()[:6],
"path": self.database_url(name),
"tables_truncated": sorted(
tables.values(), key=lambda t: t["count"] or 0, reverse=True
(t for t in tables.values() if t not in hidden_tables),
key=lambda t: t["count"] or 0,
reverse=True,
)[:5],
"tables_count": len(tables),
"tables_more": len(tables) > 5,