def get_table_config(clazz, tablename=None): """Returns the table (overview, listing) configuration with the name 'tablename' of this Item from the configuration file. If the default table configuration will be returned. The table configuration is cached for later requests. :clazz: @todo :tablename: @todo :returns: @todo """ # As this is a class method of the BaseItem we need to build a # unique cachename for tableconfigs among all inherited classes. cachename = "%s.%s" % (clazz.__name__, tablename) if not CACHE_TABLE_CONFIG.get(cachename): CACHE_TABLE_CONFIG.set(cachename, TableConfig(clazz, tablename)) return CACHE_TABLE_CONFIG.get(cachename)
def test_clear_cache(): from ringo.lib.cache import CACHE_TABLE_CONFIG, CACHE_FORM_CONFIG CACHE_TABLE_CONFIG.clear() CACHE_FORM_CONFIG.clear()