mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Row count fix + sort index page databases alphabetically
Sorting alphabetically should fix a test failure in Python 3.5 Refs #460
This commit is contained in:
parent
5d6b2c30f1
commit
79303163b2
2 changed files with 9 additions and 6 deletions
|
|
@ -73,7 +73,7 @@ class IndexView(RenderMixin):
|
|||
"tables_and_views_more": (len(visible_tables) + len(views))
|
||||
> TRUNCATE_AT,
|
||||
"tables_count": len(visible_tables),
|
||||
"table_rows_sum": sum((t["count"] or 0) for t in tables.values()),
|
||||
"table_rows_sum": sum((t["count"] or 0) for t in visible_tables),
|
||||
"hidden_table_rows_sum": sum(
|
||||
t["count"] for t in hidden_tables if t["count"] is not None
|
||||
),
|
||||
|
|
@ -81,6 +81,9 @@ class IndexView(RenderMixin):
|
|||
"views_count": len(views),
|
||||
}
|
||||
)
|
||||
|
||||
databases.sort(key=lambda database: database["name"])
|
||||
|
||||
if as_format:
|
||||
headers = {}
|
||||
if self.ds.cors:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue