- Fixed bug in connection pool cursor wrapper whereby if a
cursor threw an exception on close(), the logging of the
message would fail. [ticket:1786]
-
+
+ - the _make_proxy() method of ColumnClause and Column now use
+ self.__class__ to determine the class of object to be returned
+ instead of hardcoding to ColumnClause/Column, making it slightly
+ easier to produce specific subclasses of these which work in
+ alias/subquery situations.
+
- engines
- Fixed building the C extensions on Python 2.4. [ticket:1781]
"""
fk = [ForeignKey(f.column) for f in self.foreign_keys]
- c = Column(
+ c = self._constructor(
name or self.name,
self.type,
key = name or self.key,
return c
+ @property
+ def _constructor(self):
+ """return the 'constructor' for this ClauseElement.
+
+ This is for the purposes for creating a new object of
+ this type. Usually, its just the element's __class__.
+ However, the "Annotated" version of the object overrides
+ to return the class of its proxied element.
+
+ """
+ return self.__class__
+
@util.memoized_property
def _cloned_set(self):
"""Return the set consisting all cloned anscestors of this
# propagate the "is_literal" flag only if we are keeping our name,
# otherwise its considered to be a label
is_literal = self.is_literal and (name is None or name == self.name)
- c = ColumnClause(
+ c = self._constructor(
name or self.name,
selectable=selectable,
type_=self.type,
def _deannotate(self):
return self.__element
+
+ @property
+ def _constructor(self):
+ return self.__element.__class__
def _clone(self):
clone = self.__element._clone()