diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-02 19:55:33 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-02 19:55:33 +0000 |
commit | e92d5cff7ed2a26b119ddae8fdef856c4274c297 (patch) | |
tree | 088d530ee757c2ba75d40a57b74d8b69e0d20acf /lib/sqlalchemy/util.py | |
parent | 9c76fa6cb5f07785e827377daa689612b975656f (diff) | |
download | sqlalchemy-e92d5cff7ed2a26b119ddae8fdef856c4274c297.tar.gz |
- 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).
Diffstat (limited to 'lib/sqlalchemy/util.py')
-rw-r--r-- | lib/sqlalchemy/util.py | 9 |
1 files changed, 5 insertions, 4 deletions
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) |