Commits

Mike Bayer committed a2950f0

- Fixed bug introduced in 0.5.4 whereby Composite types
fail when default-holding columns are flushed.

Comments (0)

Files changed (4)

 CHANGES
 =======
 
+0.5.4p3
+=======
+- orm
+    - Fixed bug introduced in 0.5.4 whereby Composite types
+      fail when default-holding columns are flushed.
+    
 0.5.4p2
 =======
 

lib/sqlalchemy/__init__.py

 __all__ = sorted(name for name, obj in locals().items()
                  if not (name.startswith('_') or inspect.ismodule(obj)))
                  
-__version__ = '0.5.4p2'
+__version__ = '0.5.4p3'
 
 del inspect, sys

lib/sqlalchemy/orm/properties.py

         obj = state.get_impl(self.key).get(state, state.dict)
         if obj is None:
             obj = self.composite_class(*[None for c in self.columns])
-            state.get_impl(self.key).set(state, obj, None)
+            state.get_impl(self.key).set(state, state.dict, obj, None)
 
         if hasattr(obj, '__set_composite_values__'):
             values = list(obj.__composite_values__())
         sess.flush()
 
         assert f1.foob == FBComposite(2, 5, 15, None)
+        
+        
+        f2 = Foobar()
+        sess.add(f2)
+        sess.flush()
+        assert f2.foob == FBComposite(2, None, 15, None)
+        
     
     @testing.resolve_artifact_names
     def test_set_composite_values(self):