if isinstance(selectable, sql.Alias):
return _selectable_name(selectable.selectable)
elif isinstance(selectable, sql.Select):
- return ''.join([_selectable_name(s) for s in selectable.get_display_froms()])
+ return ''.join([_selectable_name(s) for s in selectable.froms])
elif isinstance(selectable, schema.Table):
return selectable.name.capitalize()
else:
raise exceptions.ArgumentError("Could not create ForeignKey '%s' on table '%s': table '%s' has no column named '%s'" % (self._colspec, parenttable.name, table.name, str(e)))
else:
self._column = self._colspec
+
# propigate TypeEngine to parent if it didnt have one
- if self.parent.type is types.NULLTYPE:
+ if isinstance(self.parent.type, types.NullType):
self.parent.type = self._column.type
return self._column
__all__ = [ 'TypeEngine', 'TypeDecorator', 'NullTypeEngine',
'INT', 'CHAR', 'VARCHAR', 'NCHAR', 'TEXT', 'FLOAT', 'DECIMAL',
'TIMESTAMP', 'DATETIME', 'CLOB', 'BLOB', 'BOOLEAN', 'String', 'Integer', 'SmallInteger','Smallinteger',
- 'Numeric', 'Float', 'DateTime', 'Date', 'Time', 'Binary', 'Boolean', 'Unicode', 'PickleType', 'NULLTYPE',
+ 'Numeric', 'Float', 'DateTime', 'Date', 'Time', 'Binary', 'Boolean', 'Unicode', 'PickleType', 'NULLTYPE', 'NullType',
'SMALLINT', 'DATE', 'TIME','Interval'
]