mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
New sortable_columns option in metadata.json to control sort options
You can now explicitly set which columns in a table can be used for sorting
using the _sort and _sort_desc arguments using metadata.json:
{
"databases": {
"database1": {
"tables": {
"example_table": {
"sortable_columns": [
"height",
"weight"
]
}
}
}
}
}
Refs #189
This commit is contained in:
parent
7ef95d6b96
commit
d1756d7736
7 changed files with 93 additions and 23 deletions
|
|
@ -68,9 +68,19 @@ METADATA = {
|
|||
'simple_primary_key': {
|
||||
'description_html': 'Simple <em>primary</em> key',
|
||||
'title': 'This <em>HTML</em> is escaped',
|
||||
}
|
||||
},
|
||||
'sortable': {
|
||||
'sortable_columns': [
|
||||
'sortable',
|
||||
'sortable_with_nulls',
|
||||
'sortable_with_nulls_2',
|
||||
]
|
||||
},
|
||||
'no_primary_key': {
|
||||
'sortable_columns': [],
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue