From e92d5cff7ed2a26b119ddae8fdef856c4274c297 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Sep 2007 19:55:33 +0000 Subject: - mapper compilation has been reorganized such that most compilation occurs upon mapper construction. this allows us to have fewer calls to mapper.compile() and also to allow class-based properties to force a compilation (i.e. User.addresses == 7 will compile all mappers; this is [ticket:758]). The only caveat here is that an inheriting mapper now looks for its inherited mapper upon construction; so mappers within inheritance relationships need to be constructed in inheritance order (which should be the normal case anyway). --- lib/sqlalchemy/util.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/util.py') diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 321540419..633e6b0c1 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -122,10 +122,11 @@ def hash(string): class ArgSingleton(type): instances = {} - def dispose_static(self, *args): - hashkey = (self, args) - #if hashkey in ArgSingleton.instances: - del ArgSingleton.instances[hashkey] + def dispose(cls): + for key in ArgSingleton.instances: + if key[0] is cls: + del ArgSingleton.instances[key] + dispose = classmethod(dispose) def __call__(self, *args): hashkey = (self, args) -- cgit v1.2.1