diff options
author | 2018-04-15 18:47:58 +0200 | |
---|---|---|
committer | 2018-04-15 17:47:58 +0100 | |
commit | f5e7c358761ee49da45933e73b943fb1eb66c030 (patch) | |
tree | cde9eed9f010caba22842d39af33385aae411a45 /pysite/mixins.py | |
parent | Added an About category with Partners view (#1pv7h) (#50) (diff) |
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.
Diffstat (limited to 'pysite/mixins.py')
-rw-r--r-- | pysite/mixins.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/pysite/mixins.py b/pysite/mixins.py index efbc2d0c..0a9402a9 100644 --- a/pysite/mixins.py +++ b/pysite/mixins.py @@ -4,7 +4,6 @@ from weakref import ref from flask import Blueprint from rethinkdb.ast import Table -from pysite.constants import DEBUG_MODE from pysite.database import RethinkDB @@ -53,9 +52,6 @@ class DBMixin: cls._db = ref(manager.db) - if DEBUG_MODE: - manager.db.create_table(cls.table_name, primary_key=cls.table_primary_key) - @property def table(self) -> Table: return self.db.query(self.table_name) |