aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/tables.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-05-19 20:13:51 +0200
committerGravatar GitHub <[email protected]>2018-05-19 20:13:51 +0200
commit4bba9d0cdf8361e5529281a98d14bc4bb0ceb669 (patch)
tree5747395e8dae9a42f6935da1979bb2a88abaef75 /pysite/tables.py
parent[Jams] Some amount of public display, but links not ready yet (diff)
Snake cog (#71)
* Tables that are initialized with JSON files in the table_init folder will now sync properly if the JSON file is changed after initialization. Any lines that are either added or removed will be updated whenever site is rebooted. * Initial API endpoint for snake_quiz * reverting database.py * I WILL KILL YOU * Added the snake_fact API endpoint * Moving snake tables to the new migrations system * Set up initial data for all new tables, added table objects, wrote endpoints, and wrote tests for the new endpoints. * Removing the snake_movies endpoint. That idea didn't pan out. * Added an endpoint for getting special snake cases * broken json * Fixing the initial data slightly, better picture of bob. * Changing JSON indentation to be 4 spaces consistently in all initial_data, to address Aperture's review. Also changing all the endpoints to have correct namespacing, addressing gdude's review. * Fixing tests to point to new API endpoints
Diffstat (limited to 'pysite/tables.py')
-rw-r--r--pysite/tables.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/pysite/tables.py b/pysite/tables.py
index c180e161..c592333d 100644
--- a/pysite/tables.py
+++ b/pysite/tables.py
@@ -126,6 +126,52 @@ TABLES = {
])
),
+ "snake_facts": Table( # Snake facts
+ primary_key="fact",
+ keys=sorted([
+ "fact"
+ ]),
+ locked=False
+ ),
+
+ "snake_idioms": Table( # Snake idioms
+ primary_key="idiom",
+ keys=sorted([
+ "idiom"
+ ]),
+ locked=False
+ ),
+
+ "snake_names": Table( # Snake names
+ primary_key="name",
+ keys=sorted([
+ "name",
+ "scientific"
+ ]),
+ locked=False
+ ),
+
+ "snake_quiz": Table( # Snake questions and answers
+ primary_key="id",
+ keys=sorted([
+ "id",
+ "question",
+ "options",
+ "answerkey"
+ ]),
+ locked=False
+ ),
+
+ "special_snakes": Table( # Special case snakes for the snake converter
+ primary_key="name",
+ keys=sorted([
+ "name",
+ "info",
+ "image_list",
+ ]),
+ locked=False
+ ),
+
"tags": Table( # Tag names and values
primary_key="tag_name",
keys=sorted([