公共接口

class cool.core.constants.Constants[源代码]

常量管理基类

class TestConstants(Constants):
    TEST0 = (0, _('test0desc'))
    TEST1 = (1, _('test desc'))
    TEST2 = (2, _('test desc'))

InlineConstants = Enum('InlineConstants', (('a', (1,2)), ('b', (3,4))))
class cool.core.cache.BaseCache[源代码]

缓存管理基类

class MyCache(BaseCache):
    key_prefix = 'my_cache'
    default_timeout = 600
    item1 = CacheItem()
    item2 = CacheItem()

cache = MyCache()
cache.item1.set("test", 1)
cache.item1.get("test")