Package bazaar :: Module cache :: Class LazyObject
[show private | hide private]
[frames | no frames]

Class LazyObject

          Cache --+    
                  |    
               Lazy --+
                      |
       UserDict --+   |
                  |   |
WeakValueDictionary --+
                      |
                     LazyObject


Cache for lazy referenced object loading.
Method Summary
  __init__(self, owner)
Create object lazy cache.
  itervalues(self)
Return all application class objects from database.
  load(self, key)
Load referenced object with primary key value key.
    Inherited from Lazy
  __getitem__(self, param)
Return referenced object or association data.
    Inherited from WeakValueDictionary
  __iter__(self)
  __repr__(self)
  __setitem__(self, key, value)
  copy(self)
  get(self, key, default)
  items(self)
  iteritems(self)
  iterkeys(self)
  pop(self, key, *args)
  popitem(self)
  setdefault(self, key, default)
  update(self, dict)
  values(self)
    Inherited from UserDict
  __cmp__(self, dict)
  __contains__(self, key)
  __delitem__(self, key)
  __len__(self)
  clear(self)
  fromkeys(cls, iterable, value)
(Class method)
  has_key(self, key)
  keys(self)

Instance Variable Summary
    Inherited from Lazy
  dicttype: Weak dictionary superclass, i.e.
    Inherited from Cache
  owner: Owner of the cache - object broker or association object.

Instance Method Details

__init__(self, owner)
(Constructor)

Create object lazy cache.
Parameters:
owner - Owner of the cache - object broker or association object.
Overrides:
bazaar.cache.Cache.__init__

itervalues(self)

Return all application class objects from database.

Method load objects from database, then checks if specific object exists in cache. If exists then object from cache is returned instead of object from database.
Overrides:
weakref.WeakValueDictionary.itervalues

load(self, key)

Load referenced object with primary key value key.
Overrides:
bazaar.cache.Cache.load

Generated by Epydoc 2.0 on Sun May 23 19:11:16 2004 http://epydoc.sf.net