mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Compare commits
5 commits
main
...
debug-trav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db23da7ae1 |
||
|
|
59a3aa859c |
||
|
|
97cf5151ba |
||
|
|
00de2e8235 |
||
|
|
2aa9d4a097 |
3 changed files with 10 additions and 2 deletions
|
|
@ -5,4 +5,4 @@ python:
|
|||
- 3.6
|
||||
|
||||
script:
|
||||
- python setup.py test
|
||||
- pip install pytest aiohttp beautifulsoup4 && python setup.py install && pytest -vv
|
||||
|
|
|
|||
|
|
@ -619,9 +619,11 @@ class TableView(RowTableShared):
|
|||
if use_rowid:
|
||||
select = 'rowid, *'
|
||||
order_by = 'rowid'
|
||||
order_by_pks = 'rowid'
|
||||
else:
|
||||
select = '*'
|
||||
order_by = ', '.join(pks)
|
||||
order_by_pks = ', '.join([escape_sqlite(pk) for pk in pks])
|
||||
order_by = order_by_pks
|
||||
|
||||
if is_view:
|
||||
order_by = ''
|
||||
|
|
@ -792,6 +794,9 @@ class TableView(RowTableShared):
|
|||
)
|
||||
)
|
||||
params['p{}'.format(len(params))] = sort_value
|
||||
order_by = '{}, {}'.format(
|
||||
order_by, order_by_pks
|
||||
)
|
||||
else:
|
||||
where_clauses.extend(next_by_pk_clauses)
|
||||
|
||||
|
|
|
|||
|
|
@ -460,6 +460,9 @@ def test_sortable(app_client, query_string, sort_key, human_description_en):
|
|||
assert 5 == page
|
||||
expected = list(generate_sortable_rows(201))
|
||||
expected.sort(key=sort_key)
|
||||
import json
|
||||
print('expected = {}'.format(json.dumps(expected)))
|
||||
print('fetched = {}'.format(json.dumps(fetched)))
|
||||
assert [
|
||||
r['content'] for r in expected
|
||||
] == [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue