]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed regression in new composite rewrite where
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 14 Aug 2011 15:18:08 +0000 (11:18 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 14 Aug 2011 15:18:08 +0000 (11:18 -0400)
    deferred=True option failed due to missing
    import [ticket:2253]

CHANGES
lib/sqlalchemy/orm/descriptor_props.py
test/orm/test_composites.py

diff --git a/CHANGES b/CHANGES
index 485774dc270ef2b7b10e2975fdcb9f8f8bcdc200..5b504772d8eac71d4d42e179460da6c959163a1e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,10 @@ CHANGES
      when the Session.is_active is True.
      [ticket:2241]
 
+  - Fixed regression in new composite rewrite where
+    deferred=True option failed due to missing
+    import [ticket:2253]
+
   - Fixed bug in query.join() which would occur
     in a complex multiple-overlapping path scenario,
     where the same table could be joined to
index 311993c0d72b8484e1c7297c33994e13aaf291c3..f43952279a795b03464c94b72eebcd46b081d450 100644 (file)
@@ -13,7 +13,7 @@ as actively in the load/persist ORM loop.
 from sqlalchemy.orm.interfaces import \
     MapperProperty, PropComparator, StrategizedProperty
 from sqlalchemy.orm.mapper import _none_set
-from sqlalchemy.orm import attributes
+from sqlalchemy.orm import attributes, strategies
 from sqlalchemy import util, sql, exc as sa_exc, event, schema
 from sqlalchemy.sql import expression
 properties = util.importlater('sqlalchemy.orm', 'properties')
index c336f40803826150007b786ae6e569f95cbd0e23..0d3cc20d6397758cca55170b4a8281519086ddb9 100644 (file)
@@ -621,4 +621,16 @@ class ConfigurationTest(fixtures.MappedTest):
         m.add_property('start', sa.orm.composite(Point, 'x1', 'y1'))
         m.add_property('end', sa.orm.composite(Point, 'x2', 'y2'))
 
-        self._test_roundtrip()
\ No newline at end of file
+        self._test_roundtrip()
+
+    def test_deferred(self):
+        edge, Edge, Point = (self.tables.edge,
+                                self.classes.Edge,
+                                self.classes.Point)
+        mapper(Edge, edge, properties={
+            'start':sa.orm.composite(Point, edge.c.x1, edge.c.y1, 
+                                            deferred=True, group='s'),
+            'end': sa.orm.composite(Point, edge.c.x2, edge.c.y2, 
+                                            deferred=True)
+        })
+        self._test_roundtrip()