From f5e7c358761ee49da45933e73b943fb1eb66c030 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 15 Apr 2018 18:47:58 +0200 Subject: Initial data for tables and refactoring the dev-mode database handling to be similar to prod-mode. (#53) * 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. --- pysite/views/wiki/edit.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'pysite/views/wiki/edit.py') diff --git a/pysite/views/wiki/edit.py b/pysite/views/wiki/edit.py index 0d70fed5..9eb50c9e 100644 --- a/pysite/views/wiki/edit.py +++ b/pysite/views/wiki/edit.py @@ -13,9 +13,7 @@ from pysite.rst import render class EditView(RouteView, DBMixin): path = "/edit/" # "path" means that it accepts slashes name = "edit" - table_name = "wiki" - table_primary_key = "slug" @require_roles(*EDITOR_ROLES) def get(self, page): -- cgit v1.2.3