From: Mike Bayer Date: Sat, 17 Sep 2005 04:41:00 +0000 (+0000) Subject: working thru test cases X-Git-Tag: rel_0_1_0~707 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b70ec5b1a6526fc24cd2b57e89b2e941979b1b13;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git working thru test cases --- diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index e605f980e7..c1982dfe4d 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -82,6 +82,8 @@ class TableSingleton(type): table = type.__call__(self, name, engine, *args, **kwargs) engine.tables[name] = table # load column definitions from the database if 'autoload' is defined + # we do it after the table is in the singleton dictionary to support + # circular foreign keys if kwargs.get('autoload', False): engine.reflecttable(table) return table @@ -93,7 +95,6 @@ class Table(SchemaItem): __metaclass__ = TableSingleton def __init__(self, name, engine, *args, **kwargs): - print "new table ! " + name + " " +repr(id(self)) self.name = name self.columns = OrderedProperties() self.c = self.columns diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 3ff237beae..c65726c16b 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -22,7 +22,7 @@ class OrderedProperties(object): def __init__(self): self.__dict__['_list'] = [] - + def keys(self): return self._list