Closed blueyed closed 6 years ago
I ran into this problem today and solved it by modifying the _decode method in panels/sql/tracking.py as follows:
from django.contrib.postgres.fields.jsonb import JsonAdapter
def _decode(self, param):
try:
if isinstance(param, list):
return map(self._decode, param)
elif isinstance(param, JsonAdapter):
return param.dumps(param.adapted)
else:
return force_text(param, strings_only=True)
except UnicodeDecodeError:
return '(encoded string)'
Not sure if it is the right approach but it works for me so far.
return self.cursor.execute(sql, params) django.db.utils.DataError: invalid input syntax for type double precision: "no"
I was getting an error when trying to select an SQL query that gets generated for a jsonb list_filter field in Django 1.9 from the SQL panel (through the "Sel" form / button):
The
WHERE
clause in the "SQL queries" page is:There is no SQL error from Django itself, so I guess that there is some double escaping / quoting involved.