aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r--mediagoblin/db/util.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py
index 1df9494c..fff71d06 100644
--- a/mediagoblin/db/util.py
+++ b/mediagoblin/db/util.py
@@ -14,5 +14,12 @@
# 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.util import (ObjectId, InvalidId,
- DESCENDING)
+try:
+ from mediagoblin.db.sql_switch import use_sql
+except ImportError:
+ use_sql = False
+
+if use_sql:
+ from mediagoblin.db.sql.fake import ObjectId, InvalidId, DESCENDING
+else:
+ from mediagoblin.db.mongo.util import ObjectId, InvalidId, DESCENDING