Show mutable DBs first in API explorer, closes #1918

This commit is contained in:
Simon Willison 2022-11-29 21:07:51 -08:00
commit 5518397338

View file

@ -371,6 +371,8 @@ class ApiExplorerView(BaseView):
"tables": tables, "tables": tables,
} }
) )
# Sort so that mutable databases are first
databases.sort(key=lambda d: not self.ds.databases[d["name"]].is_mutable)
return databases return databases
async def get(self, request): async def get(self, request):