Package pyamf :: Package adapters :: Module _google_appengine_ext_db :: Class GAEReferenceCollection
[hide private]
[frames] | no frames]

Class GAEReferenceCollection

source code


This helper class holds a dict of klass to key/objects loaded from the Datastore.


Since: 0.4.1

Instance Methods [hide private]
 
_getClass(self, klass) source code
Instance of klass.
getClassKey(self, klass, key)
Return an instance based on klass/key.
source code
 
addClassKey(self, klass, key, obj)
Adds an object to the collection, based on klass and key.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getClassKey(self, klass, key)

source code 

Return an instance based on klass/key.

If an instance cannot be found then KeyError is raised.

Parameters:
  • klass - The class of the instance.
  • key - The key of the instance.
Returns: Instance of klass.
The instance linked to the klass/key.

addClassKey(self, klass, key, obj)

source code 

Adds an object to the collection, based on klass and key.

Parameters:
  • klass - The class of the object.
  • key - The datastore key of the object.
  • obj - The loaded instance from the datastore.