enhancements for PropComparator adaption vs. AliasedClass, etc.

Issue #2756 resolved
Mike Bayer repo owner created an issue

in descriptor_props.py:

        @util.memoized_property
        def _comparable_elements(self):
            if self.adapter:
                # we need to do a little fudging here because
                # the adapter function we're given only accepts
                # ColumnElements, but our prop._comparable_elements is returning
                # InstrumentedAttribute, because we support the use case
                # of composites that refer to relationships.  The better
                # solution here is to open up how AliasedClass interacts
                # with PropComparators so more context is available.
                return [                           for x in self.prop._comparable_elements](self.adapter(x.__clause_element__())
)
            else:
                return self.prop._comparable_elements

determine if we can change the signature of PropComparator.adapted to expect a more contextual object. Would need to see who calls this method besides AliasedClass, might produce some backwards-incompatible behavior.

See also #2755, #2754.

Comments (2)

  1. Log in to comment