]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added NullType to export list
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Jul 2007 21:21:11 +0000 (21:21 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Jul 2007 21:21:11 +0000 (21:21 +0000)
- any NullType will trigger the "get col type from FK logic", though
there are other issues with this logic (requires the FK be initialized)
- added INT to sqlite resolution map
- adjusted sqlsoup for sql.Select api changes

lib/sqlalchemy/databases/sqlite.py
lib/sqlalchemy/ext/sqlsoup.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/types.py

index a5328cfcf20170333d99e68b0a08addd87e3ed1a..0fd31928af838bd2528d030c0e6133991c5683f7 100644 (file)
@@ -126,6 +126,7 @@ colspecs = {
 
 pragma_names = {
     'INTEGER' : SLInteger,
+    'INT' : SLInteger,
     'SMALLINT' : SLSmallInteger,
     'VARCHAR' : SLString,
     'CHAR' : SLChar,
index 15be667090c4aff6aeaabb79cc05a6ab30646b0a..a9b93bc56414aa5dbf8b80214e5839ca33b202d6 100644 (file)
@@ -425,7 +425,7 @@ def _selectable_name(selectable):
     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:
index f67278d7c686b08671e305e5d029c010ed2e4717..12568bd4b502608162f2a92a844f1a3b81db0ab7 100644 (file)
@@ -716,8 +716,9 @@ class ForeignKey(SchemaItem):
                     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
 
index 7dcc44eccbce0e7cb7651891bf639eea7802533b..d1ede61c50cf8ac4337468bcfee0d34182bd7397 100644 (file)
@@ -7,7 +7,7 @@
 __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'
             ]