Skip to content

Commit

Permalink
[#1427] add contitional to allow 0.8 sqlalchemy
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Jan 9, 2014
1 parent 4bddcd8 commit 917e4c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ckan/lib/dictization/__init__.py
Expand Up @@ -3,6 +3,12 @@
import sqlalchemy
from pylons import config

try:
RowProxy = sqlalchemy.engine.result.RowProxy
except AttributeError:
RowProxy = sqlalchemy.engine.base.RowProxy


# NOTE
# The functions in this file contain very generic methods for dictizing objects
# and saving dictized objects. If a specialised use is needed please do NOT extend
Expand All @@ -17,7 +23,7 @@ def table_dictize(obj, context, **kw):
model = context["model"]
session = model.Session

if isinstance(obj, sqlalchemy.engine.base.RowProxy):
if isinstance(obj, RowProxy):
fields = obj.keys()
else:
ModelClass = obj.__class__
Expand Down

0 comments on commit 917e4c6

Please sign in to comment.