From: Mike Bayer Date: Wed, 11 Jan 2006 02:52:30 +0000 (+0000) Subject: id key uses hash_key off of table now that its a short string X-Git-Tag: rel_0_1_0~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c862954c177542a422a6fed53353dd1b06b05996;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git id key uses hash_key off of table now that its a short string --- diff --git a/lib/sqlalchemy/mapping/objectstore.py b/lib/sqlalchemy/mapping/objectstore.py index 5581d60ca5..2e010911ed 100644 --- a/lib/sqlalchemy/mapping/objectstore.py +++ b/lib/sqlalchemy/mapping/objectstore.py @@ -34,8 +34,7 @@ def get_id_key(ident, class_, table): selectable - a Selectable object which represents all the object's column-based fields. this Selectable may be synonymous with the table argument or can be a larger construct containing that table. return value: a tuple object which is used as an identity key. """ - return (class_, "Table(%d)" % id(table), tuple(ident)) - + return (class_, table.hash_key(), tuple(ident)) def get_row_key(row, class_, table, primary_key): """returns an identity-map key for use in storing/retrieving an item from the identity map, given a result set row. @@ -51,7 +50,7 @@ def get_row_key(row, class_, table, primary_key): this Selectable may be synonymous with the table argument or can be a larger construct containing that table. return value: a tuple object which is used as an identity key. """ - return (class_, "Table(%d)" % id(table), tuple([row[column] for column in primary_key])) + return (class_, table.hash_key(), tuple([row[column] for column in primary_key])) def begin(): """begins a new UnitOfWork transaction. the next commit will affect only