Commits

Mike Bayer committed f6acd58

fix to typing in clause construction which specifically helps
type issues with polymorphic_union (CAST/ColumnClause propigates
its type to proxy columns)

Comments (0)

Files changed (2)

 - added "synonym()" function, applied to properties to have a 
 propname the same as another, for the purposes of overriding props
 and allowing the original propname to be accessible in select_by().
+- fix to typing in clause construction which specifically helps
+type issues with polymorphic_union (CAST/ColumnClause propigates
+its type to proxy columns)
 
 0.2.5
 - fixed endless loop bug in select_by(), if the traversal hit

lib/sqlalchemy/sql.py

         visitor.visit_cast(self)
     def _get_from_objects(self):
         return self.clause._get_from_objects()
-        
+    def _make_proxy(self, selectable, name=None):
+        if name is not None:
+            co = ColumnClause(name, selectable, type=self.type)
+            co.orig_set = self.orig_set
+            selectable.columns[name]= co
+            return co
+        else:
+            return self
+            
 class FunctionGenerator(object):
     """generates Function objects based on getattr calls"""
     def __init__(self, engine=None):
     def _bind_param(self, obj):
         return BindParamClause(self._label, obj, shortname = self.name, type=self.type)
     def _make_proxy(self, selectable, name = None):
-        c = ColumnClause(name or self.name, selectable, hidden=self.hidden)
+        c = ColumnClause(name or self.name, selectable, hidden=self.hidden, type=self.type)
         c.orig_set = self.orig_set
         if not self.hidden:
             selectable.columns[c.name] = c
             col = column._make_proxy(self, name=column._label)
         else:
             col = column._make_proxy(self, name=column.name)
-        
         try:
             colset = self._col_map[col.name]
         except KeyError:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.