Package: turbojson / 1.3.2-2.1

support-sqlalchemy-0.8 Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Add support for SQLAlchemy 0.8
Author: Margarita Manterola <marga@debian.org>
Index: turbojson/turbojson/jsonify.py
===================================================================
--- turbojson.orig/turbojson/jsonify.py	2013-11-24 16:55:58.466672501 +0100
+++ turbojson/turbojson/jsonify.py	2013-11-24 16:56:42.450890608 +0100
@@ -172,7 +172,11 @@
                 """JSONify SQLAlchemy instrumented lists."""
                 return list(obj)
 
-    from sqlalchemy.engine.base import ResultProxy, RowProxy
+    try:
+        from sqlalchemy.engine.base import ResultProxy, RowProxy
+    except ImportError:
+        # SQLAlchemy >= 0.8
+        from sqlalchemy.engine.result import ResultProxy, RowProxy
 
     @jsonify_default.when("isinstance(obj, ResultProxy)")
     def jsonify_saproxy(obj):