Commit graph

658 commits

Author SHA1 Message Date
Simon Willison
5c198f7ca5 Include table metadata when calculating applied facets
Still need to ensure facets from metadata cannot be hidden in the UI
2019-04-18 09:29:43 -07:00
Simon Willison
f5e7db07aa Removed table_count() method - I don't need it after all 2019-04-18 09:03:52 -07:00
Simon Willison
938e072ece Facet class now entirely configured in constructor 2019-04-18 09:02:46 -07:00
Simon Willison
8310ad2336 Moved MockRequest to tests/utils.py 2019-04-18 07:55:56 -07:00
Simon Willison
dae6f0c4d8 Removed rogue debug code 2019-04-18 07:53:47 -07:00
Simon Willison
ce0510f937
Merge branch 'master' into facet-refactor 2019-04-18 07:52:21 -07:00
Simon Willison
c7a11ab4e6 Only doing ColumnFacet for the moment - tidied up and added tests 2019-04-18 07:45:49 -07:00
Simon Willison
a64a39648d Cleaned up rebase mess I made 2019-04-16 21:16:09 -07:00
Simon Willison
f6cdca3f6e Tests should now pass for facets branch 2019-04-16 21:10:49 -07:00
Simon Willison
63e52c0936 WIP refactoring facets to plugin, refs #427 2019-04-16 21:10:49 -07:00
Simon Willison
b495839e60 Support multiple filters of the same type
Closes #288
2019-04-16 21:09:27 -07:00
Simon Willison
9c77e6e355 Support multiple filters of the same type
Closes #288
2019-04-15 16:44:17 -07:00
Simon Willison
661488e964 New ?column__date=yyyy-mm-dd filter 2019-04-15 16:02:20 -07:00
Simon Willison
78e9972b46 New colname__in=x,y,z filter, closes #433 2019-04-15 16:02:20 -07:00
Simon Willison
c4645c0f2b Documentation for filters, plus new documentation unit test
https://simonwillison.net/2018/Jul/28/documentation-unit-tests/
2019-04-15 16:02:20 -07:00
Simon Willison
65e913fbbc Extract and refactor filters into filters.py
This will help in implementing __in as a filter, refs #433
2019-04-15 16:02:20 -07:00
Simon Willison
458f858712 Slightly more interesting example link 2019-04-15 16:02:20 -07:00
Simon Willison
583b22aa28 New ?column__date=yyyy-mm-dd filter 2019-04-15 15:54:54 -07:00
Simon Willison
1c6649b19b New colname__in=x,y,z filter, closes #433 2019-04-15 15:43:22 -07:00
Simon Willison
2c19a27d15 Documentation for filters, plus new documentation unit test
https://simonwillison.net/2018/Jul/28/documentation-unit-tests/
2019-04-15 15:41:11 -07:00
Simon Willison
6da567dda9 Extract and refactor filters into filters.py
This will help in implementing __in as a filter, refs #433
2019-04-15 14:51:20 -07:00
Simon Willison
62810f8f7a Continue sketching out new facet design, refs #427
Includes various new partially implemented facet classes, to help exercise the API design.
2019-04-15 07:01:39 -07:00
Simon Willison
9dc7a1824b
Slightly more interesting example link 2019-04-13 15:49:07 -07:00
Simon Willison
538d91c44a WIP refactoring facets to plugin, refs #427 2019-04-13 13:03:59 -07:00
Simon Willison
d4bfb8461c Removed accidental extra default plugins module 2019-04-13 12:33:23 -07:00
Simon Willison
d1075b8259 Cleaned up pylint warnings 2019-04-13 12:20:10 -07:00
Simon Willison
13ee3c222f Moved BaseView.absolute_url() to Datasette 2019-04-13 12:16:05 -07:00
Simon Willison
274ef43bb7 Moved expand_foreign_keys() from TableView to Datasette 2019-04-13 11:48:00 -07:00
Simon Willison
f2c767c222 Fixed broken link in documentation 2019-04-12 18:57:43 -07:00
Simon Willison
bc6a9b4564
?_where= parameter on table views, closes #429
From pull request #430
2019-04-12 18:37:22 -07:00
Simon Willison
e11cb4c664 Persist show/hide state better, closes #425 2019-04-11 22:00:47 -07:00
Simon Willison
db74cf0144 ?_fts_table= and ?_fts_pk= arguments, closes #428 2019-04-11 21:21:17 -07:00
Simon Willison
9cd3b44277
Upgrade to Jinja2==2.10.1 (#426) 2019-04-10 16:13:30 -07:00
Simon Willison
78e45ead4d New ?tags__arraycontains=tag lookup against JSON fields
Part one of supporting facet-by-JSON-array, refs #359
2019-04-10 08:27:52 -07:00
Simon Willison
3a208a41d4 TableView.data() no longer uses .inspect, refs #420
BUT... it does a count(*) against the whole table which may take unbounded time.

Fixing this is part of #422
2019-04-06 20:47:10 -07:00
Simon Willison
36bd6558b0 expandable_columns() no longer uses inspect, refs #420 2019-04-06 20:46:08 -07:00
Simon Willison
db02311ebf foreign_key_tables no longer uses inspect, refs #420 2019-04-06 20:23:30 -07:00
Simon Willison
f23120a964 RowView.data() no longer uses inspect refs #420 2019-04-06 20:17:47 -07:00
Simon Willison
c882e9262f display_columns_and_rows() no longer uses inspect, refs #420 2019-04-06 20:11:08 -07:00
Simon Willison
53bf875483 expand_foreign_keys() no longer uses inspect, refs #420 2019-04-06 19:56:07 -07:00
Simon Willison
97331f3435 sortable_columns_for_table() no longer uses inspect()
Refs #420
2019-04-06 18:58:51 -07:00
Simon Willison
d8851e0011 Removed rogue print() 2019-04-06 18:54:51 -07:00
Simon Willison
468c6fd953 DatabaseDownload no longer uses .inspect(), refs #420 2019-03-31 19:04:17 -07:00
Simon Willison
29a3896fe1 .database_url(database) no longer needs inspect, refs #420 2019-03-31 16:55:38 -07:00
Simon Willison
7d0f668556 .resolve_db_name() and .execute() work without inspect
Refs #420
2019-03-31 16:51:52 -07:00
Simon Willison
0209a0a344 table_exists() now uses async SQL, refs #420 2019-03-31 11:02:22 -07:00
Simon Willison
82fec60481 Fix for TypeError
File "../datasette/app.py", line 138, in __init__
      self.files = files + immutables
    TypeError: can only concatenate tuple (not "list") to tuple
2019-03-17 16:36:35 -07:00
Simon Willison
47032636b5 'datasette serve -i immutable.db' option, refs #419 2019-03-17 16:25:15 -07:00
Simon Willison
6f6d0ff2b4
URL hashing is now off by default - closes #418
Prior to this commit Datasette would calculate the content hash of every
database and redirect to a URL containing that hash, like so:

    https://v0-27.datasette.io/fixtures => https://v0-27.datasette.io/fixtures-dd88475

This assumed that all databases were opened in immutable mode and were not
expected to change.

This will be changing as a result of #419 - so this commit takes the first step
in implementing that change by changing this default behaviour. Datasette will
now only redirect hash-free URLs under two circumstances:

* The new `hash_urls` config option is set to true (it defaults to false).
* The user passes `?_hash=1` in the URL
2019-03-17 15:55:04 -07:00
Simon Willison
afe9aa3ae0 show/hide link for SQL on custom query page
Closes #415
2019-03-14 22:22:35 -07:00