Simon Willison
b263da78e3
Reliable sort order for facets in Python 3.5, fixing test - refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
6d12580ed7
Foreign key facets are now expanded to labels, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
f4943ca89b
_facet selections persist through table form, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
1dc94f6eaa
Facets can now be toggled off again, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
142a550a99
Facet results now have "truncated" field
...
To indicate if there was more than 20 distinct values. Refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
a82175276c
_sort/_next links now use new path_with_replaced_args method
2018-05-16 08:27:24 -07:00
Simon Willison
8a4ed052a5
path_with_added_args now works with multiple existing args
2018-05-16 08:27:24 -07:00
Simon Willison
f36c9d4b4c
Facet toggling now works for integer columns, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
de05cf21aa
Facet "selected" key and toggle_url now toggles, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
2b79f2bdeb
path_with_added_args now preserves order in Python 3.5
2018-05-14 00:04:23 -03:00
Simon Willison
4301a8f3ac
Case insensitive querystring comparison, fix Python 3.5
2018-05-12 19:49:37 -03:00
Simon Willison
eaaa3ea149
Initial implementation of facets, plus tests and docs
...
Refs #255
2018-05-12 19:29:41 -03:00
Simon Willison
70ff615f1b
utils.path_with_added_args() improvements
...
* Now covered by unit tests
* Preserves original order
* Can handle multiple args of the same name, e.g. ?bar=1&bar=2
2018-05-12 18:44:09 -03:00
Simon Willison
04d21ccd08
/-/versions now includes SQLite fts_versions, closes #252
2018-05-11 10:19:25 -03:00
Simon Willison
801381b765
Default tests to using a longer timelimit
...
Every now and then a test will fail in Travis CI on Python 3.5 because it hit
the default 20ms SQL time limit.
Test fixtures now default to a 200ms time limit, and we only use the 20ms time
limit for the specific test that tests query interruption. This should make
our tests on Python 3.5 in Travis much more stable.
2018-05-05 19:44:32 -03:00
Simon Willison
1259b8ac0b
Support _search_COLUMN=text searches, closes #237
2018-05-05 19:33:08 -03:00
Simon Willison
4d6a568d6c
Unit tests for _search= feature, refs #237
2018-05-05 19:01:14 -03:00
Simon Willison
ca290719ed
Show version on /-/plugins page, closes #248
2018-05-04 15:04:33 -03:00
Simon Willison
d4da4c92c8
?_size=max option, closes #249
2018-05-04 15:03:40 -03:00
Simon Willison
bb87cf8730
Added /-/versions and /-/versions.json, closes #244
...
Sample output:
{
"python": {
"version": "3.6.3",
"full": "3.6.3 (default, Oct 4 2017, 06:09:38) \n[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]"
},
"datasette": {
"version": "0.20"
},
"sqlite": {
"version": "3.23.1",
"extensions": {
"json1": null,
"spatialite": "4.3.0a"
}
}
}
2018-05-03 11:09:27 -03:00
Simon Willison
690736436b
Bump up time limit for test_paginate_tables_and_views
...
It was intermittently failing in Travis CI on Python 3.5:
https://travis-ci.org/simonw/datasette/jobs/373713476
2018-05-01 17:20:39 -07:00
Simon Willison
349e262bb1
Renamed ?_sql_time_limit_ms= to ?_timelimit, closes #242
2018-05-01 17:20:39 -07:00
Simon Willison
a4cc5dc813
New ?_shape=array option + tweaks to _shape, closes #245
...
* Default is now ?_shape=arrays (renamed from lists)
* New ?_shape=array returns an array of objects as the root object
* Changed ?_shape=object to return the object as the root
* Updated docs
2018-05-01 17:20:39 -07:00
Simon Willison
aa954382c3
FTS tables now detected by inspect(), closes #240
2018-04-28 17:04:32 -07:00
Simon Willison
f188ceaa2a
New ?_size=XXX querystring parameter for table view, closes #229
...
Also added documentation for all of the _special arguments.
Plus deleted some duplicate logic implementing _group_count.
2018-04-25 21:47:12 -07:00
Simon Willison
4504d5160b
If max_returned_rows==page_size, increment max_returned_rows
...
Fixes #230 , where if the two were equal pagination didn't work correctly.
2018-04-25 21:04:12 -07:00
Simon Willison
02ee31c8b4
New hidden: True option for table metadat, closes #239
2018-04-25 20:42:57 -07:00
Simon Willison
00ab954300
Added CSS class rows-and-columns to main table
2018-04-23 18:31:32 -07:00
Simon Willison
f3f4295712
label_column now defined on the table-being-linked-to, fixes #234
2018-04-22 13:46:18 -07:00
Simon Willison
f27cabbaf3
label_column option in metadata.json - closes #234
2018-04-22 10:53:16 -07:00
Simon Willison
b52171db1e
Plugins can now bundle custom templates, closes #224
...
Refs #14
2018-04-18 22:50:27 -07:00
Simon Willison
b55809a1e2
Added /-/metadata /-/plugins /-/inspect, closes #225
2018-04-18 22:25:22 -07:00
Simon Willison
404fa2252b
datasette publish/package --install option, closes #223
...
Allows you to specify one or more additional packages to be installed,
useful for deploying plugins.
2018-04-18 07:55:36 -07:00
Simon Willison
1c36d07dd4
New plugin hooks: extra_css_urls() and extra_js_urls()
...
Closes #214
2018-04-17 20:12:21 -07:00
Simon Willison
a5792a8c61
<th> now gets class="col-X" - plus added col-X documentation
...
Refs #209
2018-04-17 19:11:54 -07:00
Simon Willison
dfb87d012c
Use to_css_class for table cell column classes
...
This ensures that columns with spaces in the name will still
generate usable CSS class names. Refs #209
2018-04-17 18:19:21 -07:00
Russ Garrett
136a70d887
Add column name classes to <td>s, make PK bold
2018-04-17 18:13:02 -07:00
Russ Garrett
0f782dd8df
Additional test asserts
2018-04-17 18:13:02 -07:00
Simon Willison
aaf59db570
Longer time limit for test_paginate_compound_keys
...
It was failing intermittently in Travis - see #209
2018-04-17 18:09:48 -07:00
Simon Willison
e7c769ef30
Working implementation of #216 which passes the tests
...
Reverted commit 5364fa7f33
(where I removed the
code that didn't work).
Added primary keys to order-by clause for sorting to get tests to pass
2018-04-16 18:41:55 -07:00
Simon Willison
5364fa7f33
Revert #216 until I can get tests to pass in Travis
...
Revert "Fix for _sort_desc=sortable_with_nulls test, refs #216"
This reverts commit 07fc2d113e
.
Revert "Fixed #216 - paginate correctly when sorting by nullable column"
This reverts commit 2abe539a0f
.
2018-04-16 17:53:37 -07:00
Simon Willison
07fc2d113e
Fix for _sort_desc=sortable_with_nulls test, refs #216
2018-04-16 17:05:03 -07:00
Simon Willison
2abe539a0f
Fixed #216 - paginate correctly when sorting by nullable column
2018-04-16 16:52:50 -07:00
Simon Willison
b2955d9065
New --plugins-dir=plugins/ option ( #212 )
...
* New --plugins-dir=plugins/ option
New option causing Datasette to load and evaluate all of the Python files in
the specified directory and register any plugins that are defined in those
files.
This new option is available for the following commands:
datasette serve mydb.db --plugins-dir=plugins/
datasette publish now/heroku mydb.db --plugins-dir=plugins/
datasette package mydb.db --plugins-dir=plugins/
* Unit tests for --plugins-dir=plugins/
Closes #211
2018-04-15 22:22:01 -07:00
Simon Willison
dd4491dd81
Update number of expected tables
2018-04-14 08:16:54 -07:00
Simon Willison
6b15a53cd3
Unit test for unlabelled foreign keys from #207
2018-04-14 08:00:54 -07:00
Simon Willison
d72201e883
Added unit test for foreign key links in HTML
...
Needed to add a further unit test for #207
2018-04-14 07:55:27 -07:00
Russ Garrett
ed974417ad
Tests for unit filtering
2018-04-14 15:06:52 +01:00
Simon Willison
9f28bbe43d
Better mechanism for handling errors; 404s for missing table/database
...
New error mechanism closes #193
404s for missing tables/databesse closes #184
Makes pull request #202 unnecessary.
2018-04-13 11:17:22 -07:00
Simon Willison
46b237c29a
datasette inspect now finds primary_keys
...
Closes #195
2018-04-09 17:54:12 -07:00