mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Correctly display facets with value of 0 - fixes #318
Also added comprehensive unit test for facet display HTML.
This commit is contained in:
parent
fdfbbbb9ee
commit
aeeb50f61b
5 changed files with 122 additions and 34 deletions
|
|
@ -332,27 +332,30 @@ INSERT INTO facet_cities (id, name) VALUES
|
|||
CREATE TABLE facetable (
|
||||
pk integer primary key,
|
||||
planet_int integer,
|
||||
on_earth integer,
|
||||
state text,
|
||||
city_id integer,
|
||||
neighborhood text,
|
||||
FOREIGN KEY ("city_id") REFERENCES [facet_cities](id)
|
||||
);
|
||||
INSERT INTO facetable (planet_int, state, city_id, neighborhood) VALUES
|
||||
(1, 'CA', 1, 'Mission'),
|
||||
(1, 'CA', 1, 'Dogpatch'),
|
||||
(1, 'CA', 1, 'SOMA'),
|
||||
(1, 'CA', 1, 'Tenderloin'),
|
||||
(1, 'CA', 1, 'Bernal Heights'),
|
||||
(1, 'CA', 1, 'Hayes Valley'),
|
||||
(1, 'CA', 2, 'Hollywood'),
|
||||
(1, 'CA', 2, 'Downtown'),
|
||||
(1, 'CA', 2, 'Los Feliz'),
|
||||
(1, 'CA', 2, 'Koreatown'),
|
||||
(1, 'MI', 3, 'Downtown'),
|
||||
(1, 'MI', 3, 'Greektown'),
|
||||
(1, 'MI', 3, 'Corktown'),
|
||||
(1, 'MI', 3, 'Mexicantown'),
|
||||
(2, 'MC', 4, 'Arcadia Planitia')
|
||||
INSERT INTO facetable
|
||||
(planet_int, on_earth, state, city_id, neighborhood)
|
||||
VALUES
|
||||
(1, 1, 'CA', 1, 'Mission'),
|
||||
(1, 1, 'CA', 1, 'Dogpatch'),
|
||||
(1, 1, 'CA', 1, 'SOMA'),
|
||||
(1, 1, 'CA', 1, 'Tenderloin'),
|
||||
(1, 1, 'CA', 1, 'Bernal Heights'),
|
||||
(1, 1, 'CA', 1, 'Hayes Valley'),
|
||||
(1, 1, 'CA', 2, 'Hollywood'),
|
||||
(1, 1, 'CA', 2, 'Downtown'),
|
||||
(1, 1, 'CA', 2, 'Los Feliz'),
|
||||
(1, 1, 'CA', 2, 'Koreatown'),
|
||||
(1, 1, 'MI', 3, 'Downtown'),
|
||||
(1, 1, 'MI', 3, 'Greektown'),
|
||||
(1, 1, 'MI', 3, 'Corktown'),
|
||||
(1, 1, 'MI', 3, 'Mexicantown'),
|
||||
(2, 0, 'MC', 4, 'Arcadia Planitia')
|
||||
;
|
||||
|
||||
INSERT INTO simple_primary_key VALUES (1, 'hello');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue