Fix pagination when sorted by expanded foreign key

Closes #489
This commit is contained in:
Simon Willison 2019-05-27 19:23:18 -07:00
commit 9c58d048ec
2 changed files with 4 additions and 0 deletions

View file

@ -629,6 +629,8 @@ class TableView(RowTableShared):
# If there's a sort or sort_desc, add that value as a prefix
if (sort or sort_desc) and not is_view:
prefix = rows[-2][sort or sort_desc]
if isinstance(prefix, dict) and "value" in prefix:
prefix = prefix["value"]
if prefix is None:
prefix = "$null"
else: