summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-02-17 12:56:48 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-02-17 12:56:48 +0000
commit689a144a7150b5986708628ec7c090c7d2fa2464 (patch)
tree00cbbf666ed5069130e73ec05251df72a46db454
parente329fb31782123fb3fbc840a6f551a67213c5d17 (diff)
downloadsqlalchemy-689a144a7150b5986708628ec7c090c7d2fa2464.tar.gz
- Fixed a recursive pickling issue in serializer, triggered
by an EXISTS or other embedded FROM construct.
-rw-r--r--CHANGES17
-rw-r--r--lib/sqlalchemy/sql/expression.py6
-rw-r--r--test/ext/serializer.py6
3 files changed, 23 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index d14859960..7834d5782 100644
--- a/CHANGES
+++ b/CHANGES
@@ -54,11 +54,6 @@ CHANGES
been loaded from the database. Helps with the creation of
homegrown collection loaders and such.
- - Declarative figures out joined-table inheritance primary join
- condition even if "inherits" mapper argument is given
- explicitly. Allows mixins to be used with joined table
- inheritance.
-
- sql
- Fixed missing _label attribute on Function object, others
when used in a select() with use_labels (such as when used
@@ -85,7 +80,17 @@ CHANGES
- mssql
- Preliminary support for pymssql 1.0.1
-
+
+- extensions
+
+ - Fixed a recursive pickling issue in serializer, triggered
+ by an EXISTS or other embedded FROM construct.
+
+ - Declarative figures out joined-table inheritance primary join
+ condition even if "inherits" mapper argument is given
+ explicitly. Allows mixins to be used with joined table
+ inheritance.
+
0.5.2
======
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index f790555bc..903b3052d 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2697,6 +2697,12 @@ class _FromGrouping(FromClause):
def __getattr__(self, attr):
return getattr(self.element, attr)
+ def __getstate__(self):
+ return {'element':self.element}
+
+ def __setstate__(self, state):
+ self.element = state['element']
+
class _Label(ColumnElement):
"""Represents a column label (AS).
diff --git a/test/ext/serializer.py b/test/ext/serializer.py
index 21765ff9c..dc0a029c1 100644
--- a/test/ext/serializer.py
+++ b/test/ext/serializer.py
@@ -124,6 +124,12 @@ class SerializeTest(testing.ORMTest):
q2 = serializer.loads(serializer.dumps(q), users.metadata, Session)
eq_(list(q2.all()), [(u7, u8), (u7, u9), (u7, u10), (u8, u9), (u8, u10)])
+
+ def test_any(self):
+ r = User.addresses.any(Address.email=='x')
+ ser = serializer.dumps(r)
+ x = serializer.loads(ser, users.metadata)
+ eq_(str(r), str(x))
if __name__ == '__main__':
testing.main()