Wykres commitów

37 Commity (main)

Autor SHA1 Wiadomość Data
Simon Willison 5a63ecc557 Rename metadata= to table_config= in facet code, refs #2247 2024-02-06 15:03:19 -08:00
Simon Willison dbfad6d220 Foreign key label expanding respects table permissions, closes #2178 2023-09-07 15:51:09 -07:00
Simon Willison 303c6c733d Fix for incorrectly handled _facet_size=max, refs #1804 2022-09-06 11:05:00 -07:00
Simon Willison 8430c3bc7d table facet_size in metadata, refs #1804 2022-09-06 08:59:19 -07:00
Simon Willison 4e47a2d894 Fixed bug where tables with a column called n caused 500 errors
Closes #1228
2022-03-18 18:37:54 -07:00
Simon Willison 95d0dd7a1c Fix for colliding facet types bug, closes #625
Refs #830
2021-12-16 12:12:04 -08:00
Simon Willison 20a2ed6bec Fixed bug with metadata config of array/date facets, closes #1552
Thanks @davidbgk for spotting the fix for the bug.
2021-12-16 10:47:40 -08:00
Simon Willison 250db8192c Hopefully last fix relating to #1519, #838 2021-11-20 11:09:05 -08:00
Simon Willison 08947fa764 Fix more broken base_url links
Refs #1519, #838
2021-11-20 11:03:08 -08:00
Simon Willison fe687fd020 Fixed a whole bunch of broken base_url links
Refs #1519, #838
2021-11-19 16:53:11 -08:00
Simon Willison 0156c6b5e5 Facet in predictable order for tests, refs #448 2021-11-15 17:31:33 -08:00
Simon Willison 55024b5301 _facet_array no longer confused by duplicate array items, closes #448 2021-11-15 17:19:33 -08:00
Simon Willison c306b696de Correct facet links for columns with a leading underscore, closes #1506 2021-11-13 20:44:54 -08:00
Simon Willison dd5ee8e668 Removed some unused imports
I found these with:

    flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Simon Willison 6e9b07be92 More inclusive language 2021-06-02 21:45:03 -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 9789b94da4 ?_facet_size=100 parameter, closes #1332 2021-05-22 17:34:33 -07:00
Simon Willison 47eb885cc2 JSON faceting now suggested even if column has blank strings, closes #1246 2021-02-28 19:44:04 -08:00
Miroslav Šedivý a882d67962
Modernize code to Python 3.6+ (#1158)
* Compact dict and set building
* Remove redundant parentheses
* Simplify chained conditions
* Change method name to lowercase
* Use triple double quotes for docstrings

Thanks, @eumiro!
2020-12-23 09:04:32 -08:00
Simon Willison f2e2bfcdd9 Renamed datasette.config() to .setting(), closes #1107 2020-11-24 14:06:32 -08:00
Simon Willison 30e64c8d3b
Use f-strings in place of .format()
Code transformed like so:

    pip install flynt
    flynt .
    black .
2020-11-15 15:24:22 -08:00
Simon Willison 4433306c18
Improvements + docs for db.execute() and Results class
* Including new results.first() and results.single_value() methods. Closes #685
2020-05-08 09:05:46 -07:00
Simon Willison 0091dfe3e5 More reliable tie-break ordering for facet results
I was seeing a weird bug where the order of results running tests
on my laptop was inconsistent, causing pytest failures even though
the order of tests in Travis CI was fine.

I think the fix is to explicitly state how facet ordering ties on
the count should be resolved.
2020-02-12 22:36:42 -08:00
Simon Willison fd137da7f8 Suggest column facet only if at least one count > 1
Fixes #638
2019-11-21 16:56:55 -08:00
Simon Willison 7152e76eda Don't suggest array facet if column is only [], closes #610 2019-11-01 14:45:59 -07:00
Simon Willison ba5414f16b Only inspect first 100 records for #562 2019-11-01 12:38:15 -07:00
Simon Willison 50287e7c6b Only suggest array facet for arrays of strings - closes #562 2019-11-01 12:37:46 -07:00
Simon Willison c5542abba5 Removed ManyToManyFacet for the moment, closes #550 2019-07-07 16:21:11 -07:00
Simon Willison bd4dbc8519 Rename InterruptedError => QueryInterrupted, closes #490 2019-05-27 17:16:36 -07:00
Simon Willison edb36629e7 Database.get_outbound_foreign_keys() refactor
Following this, the only module that ever makes calls to the low-level
execute_against_connection_in_thread() method is datasette/database.py
2019-05-27 11:41:44 -07:00
Simon Willison 182a3017c2 Sort keys to past tests in Python 3.5 2019-05-25 09:22:02 -07:00
Simon Willison d923d84754 Facet by many-to-many, closes #365 2019-05-25 09:06:32 -07:00
Simon Willison 967230c90e Facet by date, closes #481 2019-05-20 23:09:22 -07:00
Simon Willison b7fe722f05 Removed rogue print() 2019-05-15 20:25:51 -07:00
Simon Willison 35d6ee2790
Apply black to everything, enforce via unit tests (#449)
I've run the black code formatting tool against everything:

    black tests datasette setup.py

I also added a new unit test, in tests/test_black.py, which will fail if the code does not
conform to black's exacting standards.

This unit test only runs on Python 3.6 or higher, because black itself doesn't run on 3.5.
2019-05-03 22:15:14 -04:00
Simon Willison 53d2f00b73 Implemented ArrayFacet, closes #359 2019-05-02 20:21:27 -04: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