[POS-commit] r6432 - stoqlib/trunk/external/sqlobject
Johan Dahlin
jdahlin at async.com.br
Wed Apr 25 15:32:53 BRT 2007
Author: jdahlin
Date: Wed Apr 25 15:32:52 2007
New Revision: 6432
Modified:
stoqlib/trunk/external/sqlobject/viewable.py
Log:
Rebuild the cache, since it might have been built too early
Modified: stoqlib/trunk/external/sqlobject/viewable.py
==============================================================================
--- stoqlib/trunk/external/sqlobject/viewable.py (original)
+++ stoqlib/trunk/external/sqlobject/viewable.py Wed Apr 25 15:32:52 2007
@@ -249,8 +249,11 @@
def table_from_name(name):
# O(1), but initially expensive
global _cache
- if not _cache:
+ def _rebuild():
for table in registry(None).allClasses():
_cache[table.sqlmeta.table] = table
+
+ if not name in _cache:
+ _rebuild()
return _cache[name]
More information about the POS-commit
mailing list