Package buildbot :: Package db :: Module base
[frames] | no frames]

Module base

source code

Base classes for database handling

Classes
  DBConnectorComponent
A fixed component of the DBConnector, handling one particular aspect of the database.
  CachedMethod
Functions
 
cached(cache_name)
A decorator for "getter" functions that fetch an object from the database based on a single key.
source code
Variables
  __package__ = None
hash(x)
Function Details

cached(cache_name)

source code 

A decorator for "getter" functions that fetch an object from the database based on a single key. The wrapped method will only be called if the named cache does not contain the key.

The wrapped function must take one argument (the key); the wrapper will take a key plus an optional no_cache argument which, if true, will cause it to invoke the underlying method even if the key is in the cache.

The resulting method will have a cache attribute which can be used to access the underlying cache.

Parameters:
  • cache_name - name of the cache to use