Wykres commitów

104 Commity (909c85cd2b64646edaaa8e3c19f5cd4e51a13fad)

Autor SHA1 Wiadomość Data
Simon Willison 909c85cd2b view_actions plugin hook, closes #2297 2024-03-12 14:25:28 -07:00
Simon Willison 090dff542b
Action menu descriptions
* Refactor tests to extract get_actions_links() helper
* Table, database and query action menu items now support optional descriptions

Closes #2294
2024-03-06 22:54:06 -05:00
Simon Willison dfd4ad558b
New design for table and database action menus
Closes #2281
2024-02-25 12:54:16 -08:00
Simon Willison c3caf36af7
Template slot family of plugin hooks - top_homepage() and others
New plugin hooks:

top_homepage
top_database
top_table
top_row
top_query
top_canned_query

New datasette.utils.make_slot_function()

Closes #1191
2024-01-30 19:54:03 -08:00
Simon Willison 4535568f2c Fixed display of database color
Closes #2139, closes #2119
2023-08-10 22:16:19 -07:00
Simon Willison d97e82df3c
?_extra= support and TableView refactor to table_view
* Implemented ?_extra= option for JSON views, refs #262
* New dependency: asyncinject
* Remove now-obsolete TableView class
2023-03-22 15:49:39 -07:00
Simon Willison 5bbe2bcc50 Rename filtered_table_rows_count to count, refs #782 2022-12-31 12:52:57 -08:00
Simon Willison 51d60d7ddf details-menu class to avoid accidential details closure
Refs https://github.com/simonw/datasette/issues/1871#issuecomment-1312821031
2022-11-13 13:06:58 -08:00
Simon Willison 1a5e5f2aa9 Refactor breadcrumbs to respect permissions, refs #1831 2022-10-13 14:42:52 -07:00
M. Nasimul Haque 00e59ec461
Extract facet pieces of table.html into included templates
Thanks, @nsmgr8
2022-06-20 11:05:44 -07:00
Simon Willison c496f2b663 Don't show facet in cog menu if not allow_facet, closes #1683 2022-03-24 12:16:19 -07:00
Simon Willison 8d5779acf0 Refactored alternate_url_json mechanism, refs #1620, #1533 2022-02-02 13:32:47 -08:00
Simon Willison 3ef47a0896 Link rel=alternate header for tables and rows
Also added Access-Control-Expose-Headers: Link to --cors mode.

Closes #1533

Refs https://github.com/simonw/datasette-notebook/issues/2

LL#	metadata.json.1
2022-02-01 23:49:09 -08:00
Simon Willison 3658e57ac2 Fixed bug with table title element, closes #1560 2022-01-13 14:20:07 -08:00
Simon Willison eb53837d2a Always show count of distinct facet values, closes #1556
Refs #1423
2021-12-15 09:58:01 -08:00
Simon Willison 763d0a0faa Fix for cog menu default facet bug, closes #1469 2021-10-13 14:20:03 -07:00
Simon Willison adb5b70de5 Show count of facet values if ?_facet_size=max, closes #1423 2021-08-16 11:56:32 -07:00
Simon Willison ca4f83dc7b Rename config= to settings=, refs #1432 2021-08-12 18:10:36 -07:00
Simon Willison e837095ef3
Column metadata, closes #942 2021-08-12 16:53:23 -07:00
Simon Willison 7e983fede6 ?_facet_size=max, ... now links to that, closes #1337
Refs #1332
2021-05-27 09:00:58 -07:00
Simon Willison 2a981e2ac1 Blank foreign key labels now show as hyphens, closes #1086 2020-11-11 15:44:04 -08:00
Simon Willison 7b19492070 database_actions() plugin hook, closes #1077 2020-11-02 10:27:25 -08:00
Simon Willison 2f7731e9e5 table_actions() plugin hook plus menu, closes #1066
Refs #690
2020-10-29 22:16:41 -07:00
Simon Willison 62286b46a9 Tighten up table column CSS 2020-10-27 12:39:55 -07:00
Simon Willison fe5e813f06 Styled facets with different bullets 2020-10-27 12:39:55 -07:00
Simon Willison 310c3a3e05 New datasette.urls URL builders, refs #904 2020-10-19 17:33:59 -07:00
Simon Willison c13d184704 Emergency fix for broken links in 0.50, closes #1010 2020-10-09 17:33:13 -07:00
Simon Willison 8f97b9b58e
datasette.client internal requests mechanism
Closes #943

* Datasette now requires httpx>=0.15
* Support OPTIONS without 500, closes #1001
* Added internals tests for datasette.client methods
* Datasette's own test mechanism now uses httpx to simulate requests
* Tests simulate HTTP 1.1 now
* Added base_url in a bunch more places
* Mark some tests as xfail - will remove that when new httpx release ships: #1005
2020-10-09 09:11:24 -07:00
Simon Willison ae1f7c3870 Column action menu for sort/faceting, refs #981 2020-09-30 14:43:39 -07:00
Simon Willison ea340cf320 Correctly persist selected facets in hidden fields
Closes #963
2020-09-12 14:54:01 -07:00
Simon Willison 49d6d2f7b0 allow_sql block to control execute-sql upermission in metadata.json, closes #813
Also removed the --config allow_sql:0 mechanism in favour of the new allow_sql block.
2020-06-08 17:05:44 -07:00
Simon Willison aa420009c0 Show padlock on private table page, refs #811 2020-06-08 11:07:11 -07:00
Simon Willison 7656fd64d8
base_url configuration setting, closes #394
* base_url configuration setting
* base_url works for static assets as well
2020-03-24 17:18:43 -07:00
Simon Willison 787dd427de white-space: pre-wrap for table SQL, closes #505 2019-07-07 13:26:38 -07:00
Simon Willison a18e0964ec Refactor templates for better top nav customization, refs #540 2019-07-05 13:34:41 -07:00
Simon Willison e7120d91f6 Rename _rows_and_columns.html to _table.html, refs #521 2019-07-02 20:23:05 -07:00
Simon Willison ea66c45df9
Extract facet code out into a new plugin hook, closes #427 (#445)
Datasette previously only supported one type of faceting: exact column value counting.

With this change, faceting logic is extracted out into one or more separate classes which can implement other patterns of faceting - this is discussed in #427, but potential upcoming facet types include facet-by-date, facet-by-JSON-array, facet-by-many-2-many and more.

A new plugin hook, register_facet_classes, can be used by plugins to add in additional facet classes.

Each class must implement two methods: suggest(), which scans columns in the table to decide if they might be worth suggesting for faceting, and facet_results(), which executes the facet operation and returns results ready to be displayed in the UI.
2019-05-02 17:11:26 -07:00
Russ Garrett cf406c0754 New plugin hook: register_output_renderer hook (#441)
Thanks @russss!

* Add register_output_renderer hook

This changeset refactors out the JSON renderer and then adds a hook and
dispatcher system to allow custom output renderers to be registered.

The CSV output renderer is untouched because supporting streaming
renderers through this system would be significantly more complex, and
probably not worthwhile.

We can't simply allow hooks to be called at request time because we need
a list of supported file extensions when the request is being routed in
order to resolve ambiguous database/table names. So, renderers need to
be registered at startup.

I've tried to make this API independent of Sanic's request/response
objects so that this can remain stable during the switch to ASGI. I'm
using dictionaries to keep it simple and to make adding additional
options in the future easy.

Fixes #440
2019-05-01 16:01:56 -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 db74cf0144 ?_fts_table= and ?_fts_pk= arguments, closes #428 2019-04-11 21:21:17 -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 b5dd83981a Export option: _shape=array&_nl=on for newline-delimited JSON 2019-01-27 17:40:23 -08:00
Simon Willison 996e8822d2 Fix CSV export hidden form fields, closes #393 2019-01-02 18:43:56 -08:00
Simon Willison fe5b6ea95a
Hide 'view and edit SQL' if config.allow_sql turned off 2018-08-05 20:17:17 -07:00
Simon Willison aeeb50f61b
Correctly display facets with value of 0 - fixes #318
Also added comprehensive unit test for facet display HTML.
2018-06-20 21:30:13 -07:00
Simon Willison fdfbbbb9ee
Default 'expand labels' to checked in CSV advanced export 2018-06-20 09:15:33 -07:00
Simon Willison 54f805dca3
Advanced export box now obeys allow_csv_stream config - refs #266 2018-06-18 08:11:11 -07:00
Simon Willison 04c896160a
Renamed 'stream all records' to 'stream all rows', refs #266 2018-06-18 07:25:44 -07:00
Simon Willison 83f4ef7ec7
Improved UI for CSV/JSON export, closes #266 2018-06-17 23:05:18 -07:00
Simon Willison 3a79ad98ea
Basic CSV export, refs #266
Tables and custom SQL query results can now be exported as CSV.

The easiest way to do this is to use the .csv extension, e.g.

	/test_tables/facet_cities.csv

By default this is served as Content-Type: text/plain so you can see it in
your browser. If you want to download the file (using text/csv and with an
appropriate Content-Disposition: attachment header) you can do so like this:

	/test_tables/facet_cities.csv?_dl=1

We link to the CSV and downloadable CSV URLs from the table and query pages.

The links use ?_size=max and so by default will return 1,000 rows.

Also fixes #303 - table names ending in .json or .csv are now detected and
URLs are generated that look like this instead:

	/test_tables/table%2Fwith%2Fslashes.csv?_format=csv

The ?_format= option is available for everything else too, but we link to the
.csv / .json versions in most cases because they are aesthetically pleasing.
2018-06-14 23:51:23 -07:00