From 35e0f4466677602e9ec6db614e8ea881dbf656cb Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Fri, 20 Apr 2018 22:12:03 +0200 Subject: [#1eeu1] Hiphopify (#54) * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes. * Almost done with the initial build for this. Implemented GET and DELETE, in order to finish POST I need to expand the database.py interface class. * Alphabetized database convenience wrappers. * Fixed a few typehints and added the sample convenience wrapper to the database class. * Finishing up the POST method and adding a duration parser to the utils folder so we can handle strings like 2w3d and turn them into a timestamp. * Fixed API blueprint loading, which was broken by the setup method in the DBMixIn. I'd forgotten to remove the check for table_name attribute. Also adde some logging and got the DELETE route working. * Added timezone-sensitivity to the duration parser so it will work with rethink. renamed the json and fixed some bugs in the hiphopify API. * Added a utility to test if rdb timestamps are expired, and only returning data from the GET calls if it isn't expired. * changed some log wording * Setting up Lil Joseph as default image. Adding some rappers to the list. * Adding a bunch of logging * These tests no longer apply. New tests must be written in the long run, removing them for now. * Addressing review comments left by Volcyy * Fixed misleading comment. --- pysite/database/table_init/hiphopify_namelist.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pysite/database') diff --git a/pysite/database/table_init/hiphopify_namelist.json b/pysite/database/table_init/hiphopify_namelist.json index 888051b1..28d6242a 100644 --- a/pysite/database/table_init/hiphopify_namelist.json +++ b/pysite/database/table_init/hiphopify_namelist.json @@ -1581,7 +1581,7 @@ }, { "name": "Fonzworth Bentley", - "image_url": "https://www.vegasnews.com/wp-content/uploads/32809-fonzworth-bentley-2-588.jpg" + "image_url": "https://i.ytimg.com/vi/PKT8_mXk1-g/maxresdefault.jpg" }, { "name": "Fort Minor", @@ -2659,6 +2659,10 @@ "name": "Lil' Jon", "image_url": "http://s3.amazonaws.com/rapgenius/lil-jon-w.jpg" }, + { + "name": "Lil' Joseph", + "image_url": "http://beardfist.com/images/lil_joseph.png" + }, { "name": "Lil' Mama", "image_url": "http://images2.fanpop.com/image/photos/11900000/Lil-Mama-3-female-rappers-11934192-440-348.jpg" @@ -3741,7 +3745,7 @@ }, { "name": "RZA", - "image_url": "http://www.sosoactive.com/wp-content/uploads/2014/04/rza-2.jpg" + "image_url": "https://static01.nyt.com/images/2012/10/21/arts/21RZA1_SPAN/21RZA1_SPAN-jumbo.jpg" }, { "name": "R. Kelly", @@ -5003,6 +5007,10 @@ "name": "X Clan", "image_url": "http://www.xxlmag.com/files/2015/03/x-clan-feat2.jpg" }, + { + "name": "Yolandi Visser", + "image_url": "https://i.pinimg.com/originals/d0/fd/b2/d0fdb22ac606edd8f1bd15abd8d67faa.jpg" + }, { "name": "Young Jeezy", "image_url": "http://pennylibertygbow.files.wordpress.com/2012/02/youngjeezy3.jpg" -- cgit v1.2.3