Wykres commitów

1001 Commity (6d7cb02f00010d3cb4b4bac0460d41277652b80e)

Autor SHA1 Wiadomość Data
Simon Willison 0120c24927
extra_css_urls/extra_js_urls in metadata, refs #153
A mechanism in the metadata.json format for adding custom CSS and JS urls.

Create a metadata.json file that looks like this:

    {
        "extra_css_urls": [
            "https://simonwillison.net/static/css/all.bf8cd891642c.css"
        ],
        "extra_js_urls": [
            "https://code.jquery.com/jquery-3.2.1.slim.min.js"
        ]
    }

Then start datasette like this:

    datasette mydb.db --metadata=metadata.json

The CSS and JavaScript files will be linked in the <head> of every page.

You can also specify a SRI (subresource integrity hash) for these assets:

    {
        "extra_css_urls": [
            {
                "url": "https://simonwillison.net/static/css/all.bf8cd891642c.css",
                "sri": "sha384-9qIZekWUyjCyDIf2YK1FRoKiPJq4PHt6tp/ulnuuyRBvazd0hG7pWbE99zvwSznI"
            }
        ],
        "extra_js_urls": [
            {
                "url": "https://code.jquery.com/jquery-3.2.1.slim.min.js",
                "sri": "sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
            }
        ]
    }

Modern browsers will only execute the stylsheet or JavaScript if the SRI hash
matches the content served. You can generate hashes using www.srihash.org
2017-11-28 18:38:15 -08:00
Simon Willison 36701c8592
datasette build now takes --load-extension 2017-11-26 15:02:01 -08:00
Simon Willison de6c62ed9a
Load SQLite extensions inside .inspect() too 2017-11-26 15:02:00 -08:00
Simon Willison 23a4575818
Added News section to Readme 2017-11-25 13:40:43 -08:00
Simon Willison efb82da927
datasette => Datasette 2017-11-24 19:46:24 -08:00
Simon Willison c160f15c39
Release version 0.13 2017-11-24 19:33:39 -08:00
Simon Willison 17fee0cc14
Automatically deploy tags as PyPI releases
https://docs.travis-ci.com/user/deployment/pypi/
2017-11-24 19:32:47 -08:00
Simon Willison 0d3479ba32
Release notes for 0.13 2017-11-24 19:32:24 -08:00
Simon Willison e3dd2483bb
Fixed quoting on foreign-key links to tables with spaces in name 2017-11-24 16:05:28 -08:00
Simon Willison c5c923d93c
Don't incorrectly detect VIEWs as supporting FTS 2017-11-24 14:51:00 -08:00
Simon Willison a81c62d848
Tweaked custom SQL results display
Closes #149
2017-11-24 14:41:31 -08:00
Simon Willison a802cbee74
Search now applies to current filters
Combined search into the same form as filters.

Closes #133
2017-11-24 14:29:54 -08:00
Simon Willison 8a37baba14
Much tidier design for table view header
Closes #147
2017-11-24 14:02:39 -08:00
Simon Willison a53d09d919
Show count of matching rows on table view
Closes #127
2017-11-24 14:01:53 -08:00
Simon Willison ab32bd6427
Fixed bug with params other than p0
p1 and upwards were not correctly extracted.
2017-11-24 13:55:00 -08:00
Simon Willison b450778391
Added column__not=blah filter
Closes #148
2017-11-23 14:09:50 -08:00
Simon Willison 4b7596ee5c
Row page now resolves foreign keys
Closes #132
2017-11-23 13:51:16 -08:00
Simon Willison a30c5b220c
Fixed bug on rows page, added unit test
Rows page for rows that linked to the same table in more
than one columns were display incorrectly. Fixed that and added a test.

Also introduced /db/table/row-pk.json?_extras=foreign_key_tables

This is used by the new unit test, but is the first example of a new
?_extras=comma-separated-list pattern I am introducing.
2017-11-23 13:09:45 -08:00
Simon Willison 7708887681
Tweaked styling of submit buttons and search box 2017-11-23 12:39:26 -08:00
Simon Willison ef3eacf622
Select option for removing filters 2017-11-23 12:32:54 -08:00
Simon Willison 22b91dd95b
Further tweaks to select/input filter styling
Refs #86 - thanks for the help, @natbat!
2017-11-23 12:05:51 -08:00
Simon Willison a74e455ced
Custom styled select boxes for filters
Refs #86
2017-11-23 07:58:55 -08:00
Simon Willison 2f97834d0e
NBSP before ID display 2017-11-22 20:45:04 -08:00
Simon Willison 38dc1ef73b
Show linked foreign key in table cells 2017-11-22 20:43:27 -08:00
Simon Willison 72e328dccf
Removed rogue print statement 2017-11-22 20:40:15 -08:00
Simon Willison 82c20ea36e
Added '- pick a column -' as first option 2017-11-22 20:39:53 -08:00
Simon Willison 0071b5d6f5
Added UI for editing table filters
Refs #86
2017-11-22 20:33:55 -08:00
Simon Willison 53534b6e9d
Even more complicated redirect scheme
This:

    ?_filter_column_1=name&_filter_op_1=contains&_filter_value_1=hello
    &_filter_column_2=age&_filter_op_2=gte&_filter_value_2=12

Now redirects to this:

    ?name__contains=hello&age__gte=12

This is needed for the filter editing interface, refs #86
2017-11-22 20:03:46 -08:00
Simon Willison c8e7c85fd3
Updated test_database_page test 2017-11-22 12:25:51 -08:00
Simon Willison 1c8638c30a
Hide FTS-created tables on index pages
Closes #129
2017-11-22 12:18:57 -08:00
Simon Willison f96e55bce5 Fix pytest version conflict
https://travis-ci.org/simonw/datasette/jobs/305929426

    pkg_resources.VersionConflict: (pytest 3.2.1 (/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages), 
    Requirement.parse('pytest==3.2.3'))
2017-11-22 12:17:51 -08:00
Simon Willison fa8eb0bf1b
Run unit tests against both Python 3.5 and 3.6 2017-11-22 09:43:52 -08:00
Simon Willison fb505de11c
Back-ported format strings for compatibility with Py 3.5
Also fixed a encoding error where Heroku --json return needs to be treated as UTF8
2017-11-22 09:42:29 -08:00
Simon Willison a9b9d42791
Mark FTS-related tables as 'hidden' in inspect()
Refs #129
2017-11-21 12:55:59 -08:00
Simon Willison e47117ce1d
Add publish to heroku support (merge pull request #104 from jacobian)
datasette publish heroku mydb.db
2017-11-21 12:55:04 -08:00
Jacob Kaplan-Moss de42240afd Some bug fixes. 2017-11-21 10:51:58 -08:00
Jacob Kaplan-Moss 75450abbe8 Merge branch 'master' into publish-heroku 2017-11-21 10:19:42 -08:00
Jacob Kaplan-Moss 1f79be7e4e More error checking and docs 2017-11-21 10:10:48 -08:00
Simon Willison 0331666e34
?_search=x now works directly against fts virtual table
Closes #135
2017-11-19 22:18:07 -08:00
Simon Willison 771b0ee347
Initial implementation of ?_group_count=column
URL shortcut for counting rows grouped by one or more columns.

?_group_count=column1&_group_count=column2 works as well.

SQL generated looks like this:

    select "qSpecies", count(*) as "count"
    from Street_Tree_List
    group by "qSpecies"
    order by "count" desc limit 100

Or for two columns like this:

    select "qSpecies", "qSiteInfo", count(*) as "count"
    from Street_Tree_List
    group by "qSpecies", "qSiteInfo"
    order by "count" desc limit 100

Refs #44

Still todo: clean up code a bunch (it currently fakes being a 'view'), get
foreign key expansion working.
2017-11-19 22:04:13 -08:00
Simon Willison b4e6211a97
Refactored filter logic and added human descriptions - refs #86 2017-11-19 22:03:24 -08:00
Simon Willison 523c6f9e3a
Fixed bug with FTS against tables with hyphens in the name 2017-11-19 21:59:53 -08:00
Simon Willison a5881e105a
?_filter_column=col&_filter_op=isnull__1 redirect
if filter_op contains a __ the value is set to the right hand side.

e.g.

    ?_filter_column=col&_filter_op=isnull__1&_filter_value=x

Redirects to:

    ?col__isnull=1

Refs #86
2017-11-19 12:33:30 -08:00
Simon Willison 386fb11d42
?_filter_column=col&_filter_op=op&_filter_value=value redirect
Part of implementing the filters UI (refs #86) - the following:

    /trees/Trees?_filter_column=SiteOrder&_filter_op=gt&_filter_value=2

Now redirects to this;

    /trees/Trees?SiteOrder__gt=2
2017-11-19 12:25:29 -08:00
Simon Willison ddc808f387
Added --build=master option to datasette publish and package
The `datasette publish` and `datasette package` commands both now accept an
optional `--build` argument. If provided, this can be used to specify a branch
published to GitHub that should be built into the container.

This makes it easier to test code that has not yet been officially released to
PyPI, e.g.:

    datasette publish now mydb.db --branch=master
2017-11-19 10:20:17 -08:00
Simon Willison eed6a0fe36
Implemented ?_search=XXX + UI if a FTS table is detected
Closes #131
2017-11-19 08:59:26 -08:00
Simon Willison f59c840e7d
Show row count for custom SQL queries 2017-11-19 07:54:50 -08:00
Simon Willison 80ada4dbb3
Added 'datasette --version' support
Using http://click.pocoo.org/5/api/#click.version_option
2017-11-18 21:59:16 -08:00
Simon Willison 1b04662585 Table views now show expanded foreign key references, if possible
If a table has foreign key columns, and those foreign key tables have
label_columns, the TableView will now query those other tables for the
corresponding values and display those values as links in the corresponding
table cells.

label_columns are currently detected by the inspect() function, which looks
for any table that has just two columns - an ID column and one other - and
sets the label_column to be that second non-ID column.
2017-11-17 19:15:49 -08:00
Simon Willison 6a007f6322 Row pages show incoming foreign key relationships 2017-11-17 19:15:49 -08:00