composites lost compartor_factory, re-test

Issue #2248 resolved
Mike Bayer repo owner created an issue

not sure if there was a rationale here, so tests will be needed in test/orm/test_composites.py to establish that this is possible and works as expected:

--- a/lib/sqlalchemy/orm/descriptor_props.py    Sat Aug 06 15:52:50 2011 -0400
+++ b/lib/sqlalchemy/orm/descriptor_props.py    Sat Aug 06 18:26:12 2011 -0400
@@ -80,6 +80,8 @@
         self.active_history = kwargs.get('active_history', False)
         self.deferred = kwargs.get('deferred', False)
         self.group = kwargs.get('group', None)
+        self.comparator_factory = kwargs.pop('comparator_factory',
+                                            self.__class__.Comparator)
         util.set_creation_order(self)
         self._create_descriptor()

@@ -258,7 +260,7 @@
             )

     def _comparator_factory(self, mapper):
-        return CompositeProperty.Comparator(self)
+        return self.comparator_factory(self)

     class Comparator(PropComparator):
         def __init__(self, prop, adapter=None):

Comments (4)

  1. Log in to comment