Hola, everyone!

This is my first time posting on this mailing list, so please be 
understanding if I failed to stick with rules. If someone could kindly 
point out what I did wrong, I will try to address it at my best effort.

Let me briefly describe what I'm trying to do with SQLAlchemy. I'm building 
a web application with Flask (http://flask.pocoo.org) where it uses two 
different database backend systems. It uses SQLite when deployed locally, 
while using PostgreSQL when deployed on a server.

My trick was working good until I updated SQLAlchemy from 0.9.7 to 0.9.8. I 
was doing something like this:

from sqlalchemy.dialects.postgresql import JSON

if db.engine.driver != 'psycopg2': 
    JSON = db.String 

So it actually uses a JSON-type field with PostgreSQL but uses a string 
field with SQLite. After upgrading to SQLAlchemy 0.9.8, I've been getting 
the following error message:

File 
"....lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/json.py", 
line 220, in result_processor 
 json_deserializer = dialect._json_deserializer or json.loads 
AttributeError: 'SQLiteDialect_pysqlite' object has no attribute 
'_json_deserializer'

At json.py:220,

json_deserializer = dialect._json_deserializer or json.loads

Shouldn't it be something like this?

json_deserializer = dialect._json_deserializer if hasattr(dialect, '
_json_deserializer') else json.loads

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to