aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/open.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-24 16:53:32 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-28 18:36:44 +0100
commitd7bec8577ea1b4d83df097f586324445fed1ef50 (patch)
tree61295d874f1b30d08273daa0ed0c770cc9620e0a /mediagoblin/db/open.py
parentb4e877ae9712df7c095d6a9c068ee6f2c234a059 (diff)
downloadmediagoblin-d7bec8577ea1b4d83df097f586324445fed1ef50.tar.lz
mediagoblin-d7bec8577ea1b4d83df097f586324445fed1ef50.tar.xz
mediagoblin-d7bec8577ea1b4d83df097f586324445fed1ef50.zip
Add develover sql switch
If you want to play with the current state of sql, you need a switch to turn it on. So here is the super secret developer switch. So you want to know where it is? Here it is: Create a file mediagoblin/db/sql_switch.py and put one line in it: "use_sql = True" (or False to disable again). Right, that's it. If you want to delete it, remember to delete the *.pyc too. Be careful not to "git add" it by accident!
Diffstat (limited to 'mediagoblin/db/open.py')
-rw-r--r--mediagoblin/db/open.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mediagoblin/db/open.py b/mediagoblin/db/open.py
index 32827fcb..6cd17869 100644
--- a/mediagoblin/db/open.py
+++ b/mediagoblin/db/open.py
@@ -14,5 +14,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from mediagoblin.db.mongo.open import \
- setup_connection_and_db_from_config, check_db_migrations_current
+try:
+ from mediagoblin.db.sql_switch import use_sql
+except ImportError:
+ use_sql = False
+
+if use_sql:
+ from mediagoblin.db.sql.open import \
+ setup_connection_and_db_from_config, check_db_migrations_current
+else:
+ from mediagoblin.db.mongo.open import \
+ setup_connection_and_db_from_config, check_db_migrations_current