Import the json module from flask (which tries to find the best available one)

This commit is contained in:
mvantellingen
2011-03-14 13:26:54 +01:00
parent fbb99e985f
commit b0b70d2197
2 changed files with 4 additions and 6 deletions

View File

@@ -6,8 +6,7 @@ except ImportError:
get_debug_queries = None
import simplejson
from flask import current_app
from flask import current_app, json
from flaskext.debugtoolbar.panels import DebugPanel
from flaskext.debugtoolbar.utils import format_fname, format_sql
@@ -51,7 +50,7 @@ class SQLAlchemyDebugPanel(DebugPanel):
is_select = query.statement.strip().lower().startswith('select')
_params = ''
try:
_params = simplejson.dumps(query.parameters)
_params = json.dumps(query.parameters)
except TypeError:
pass # object not JSON serializable

View File

@@ -1,7 +1,6 @@
import hashlib
import simplejson
from flask import Module, request, current_app, abort
from flask import Module, request, current_app, abort, json
from flaskext.sqlalchemy import SQLAlchemy
from flaskext.debugtoolbar.utils import format_sql
@@ -52,7 +51,7 @@ def sql_explain(render):
if not statement.lower().strip().startswith('select'):
return abort(406)
params = simplejson.loads(params)
params = json.loads(params)
db = SQLAlchemy(current_app)
if db.engine.driver == 'pysqlite':